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>
This commit is contained in:
parent
e02a171a47
commit
f6685a2716
@ -415,7 +415,7 @@ bool QAbstractEventDispatcher::filterNativeEvent(const QByteArray &eventType, vo
|
||||
if (!d->eventFilters.isEmpty()) {
|
||||
// Raise the loopLevel so that deleteLater() calls in or triggered
|
||||
// by event_filter() will be processed from the main event loop.
|
||||
QScopedScopeLevelCounter scopeLevelCounter(d->threadData);
|
||||
QScopedScopeLevelCounter scopeLevelCounter(d->threadData.loadAcquire());
|
||||
for (int i = 0; i < d->eventFilters.size(); ++i) {
|
||||
QAbstractNativeEventFilter *filter = d->eventFilters.at(i);
|
||||
if (!filter)
|
||||
|
@ -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;
|
||||
|
@ -3674,7 +3674,7 @@ QObjectPrivate::Connection *QMetaObjectPrivate::connect(const QObject *sender,
|
||||
c->sender = s;
|
||||
c->signal_index = signal_index;
|
||||
c->receiver.storeRelaxed(r);
|
||||
QThreadData *td = r->d_func()->threadData;
|
||||
QThreadData *td = r->d_func()->threadData.loadAcquire();
|
||||
td->ref();
|
||||
c->receiverThreadData.storeRelaxed(td);
|
||||
c->method_relative = method_index;
|
||||
@ -5304,7 +5304,7 @@ QMetaObject::Connection QObjectPrivate::connectImpl(const QObject *sender, int s
|
||||
std::unique_ptr<QObjectPrivate::Connection> c{new QObjectPrivate::Connection};
|
||||
c->sender = s;
|
||||
c->signal_index = signal_index;
|
||||
QThreadData *td = r->d_func()->threadData;
|
||||
QThreadData *td = r->d_func()->threadData.loadAcquire();
|
||||
td->ref();
|
||||
c->receiverThreadData.storeRelaxed(td);
|
||||
c->receiver.storeRelaxed(r);
|
||||
|
Loading…
x
Reference in New Issue
Block a user