summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/kernel/qabstracteventdispatcher.cpp2
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp4
-rw-r--r--src/corelib/kernel/qobject.cpp4
3 files changed, 5 insertions, 5 deletions
diff --git a/src/corelib/kernel/qabstracteventdispatcher.cpp b/src/corelib/kernel/qabstracteventdispatcher.cpp
index e525198828..84a688a9e4 100644
--- a/src/corelib/kernel/qabstracteventdispatcher.cpp
+++ b/src/corelib/kernel/qabstracteventdispatcher.cpp
@@ -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)
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;
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index e438c11513..63dfb1cba0 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -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);