QCoreApplication: relax an atomic load in a Q_ASSERT()

A Q_ASSERT() must not have side-effects, incl. ordering memory. So the
implicit loadAcquire() was too strong. The code must also work with
loadRelaxed(), so use that.

Amends the start of the public history.

Change-Id: Ib94bd0989d1a358b552275dc3963b014e6e4c180
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 90dbb413bf78a86d8785e797df7b1558e72f99b8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2025-06-12 21:14:09 +02:00 committed by Qt Cherry-pick Bot
parent da96dfdacc
commit 59db97fdaf

View File

@ -1951,7 +1951,7 @@ void QCoreApplication::removePostedEvents(QObject *receiver, int eventType)
#ifdef QT_DEBUG #ifdef QT_DEBUG
if (receiver && eventType == 0) { if (receiver && eventType == 0) {
Q_ASSERT(!receiver->d_func()->postedEvents); Q_ASSERT(!receiver->d_func()->postedEvents.loadRelaxed());
} }
#endif #endif