diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-05-17 17:33:39 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-05-20 20:07:37 +0200 |
commit | f6685a271677429ed2dac4232421a7bb18a78e0c (patch) | |
tree | 14bb587e3baeb657805f14015caa3b806a318efa /src/corelib/kernel/qcoreapplication.cpp | |
parent | e02a171a47e87048d16faf7167c0fecd46a176b5 (diff) |
Make all loads of QAtomicPointer QObjectPrivate::threadData explicit
Replace implicit conversions from QAtomicPointer<T> → T* with the
equivalent, but explicit, loadAcquire().
This is in preparation of deprecating the implicit QAtomic<T> ↔ T
conversions.
Change-Id: I6c8476a705c3996ef724dd63b58d9526d1a39af7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qcoreapplication.cpp')
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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; |