From f6685a271677429ed2dac4232421a7bb18a78e0c Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 17 May 2022 17:33:39 +0200 Subject: Make all loads of QAtomicPointer QObjectPrivate::threadData explicit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace implicit conversions from QAtomicPointer → T* with the equivalent, but explicit, loadAcquire(). This is in preparation of deprecating the implicit QAtomic ↔ T conversions. Change-Id: I6c8476a705c3996ef724dd63b58d9526d1a39af7 Reviewed-by: Thiago Macieira --- src/corelib/kernel/qcoreapplication.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/kernel/qcoreapplication.cpp') diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 13c792af29..43ff18fa5c 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -1026,7 +1026,7 @@ bool QCoreApplication::notifyInternal2(QObject *receiver, QEvent *event) // equivalent to QThreadData::current(), just without the function // call overhead. QObjectPrivate *d = receiver->d_func(); - QThreadData *threadData = d->threadData; + QThreadData *threadData = d->threadData.loadAcquire(); QScopedScopeLevelCounter scopeLevelCounter(threadData); if (!selfRequired) return doNotify(receiver, event); @@ -1337,7 +1337,7 @@ int QCoreApplication::exec() if (!QCoreApplicationPrivate::checkInstance("exec")) return -1; - QThreadData *threadData = self->d_func()->threadData; + QThreadData *threadData = self->d_func()->threadData.loadAcquire(); if (threadData != QThreadData::current()) { qWarning("%s::exec: Must be called from the main thread", self->metaObject()->className()); return -1; -- cgit v1.2.3