summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qobject.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2024-11-13 12:56:24 -0800
committerThiago Macieira <thiago.macieira@intel.com>2024-12-05 13:04:46 -0800
commitd7c9619a815af74a988770c2d2e5d1116f2769fb (patch)
tree278ef739fe117909a85f04cf7b5973f6bbace6de /src/corelib/kernel/qobject.cpp
parent083e44318cb481180357a0a27a3d93a85242cff3 (diff)
QObjectData: relax accesses to postedEvents
If one wants to access the event list itself, they have to lock the postedEventList mutex, so none of these probably need any more ordering than Relaxed. I've left most of them in Acquire/Release because we don't have time to reason whether Relaxed suffices (the one exception is a loadRelaxed() that calls a function that does loadAcquire()). Amends commit ba6c1d2785ca6d8a8b162abcd9d978ab0c52ea2d. Pick-to: 6.8 Change-Id: I35810f961b96aaf63d74fffd1eda73b3e059583d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/kernel/qobject.cpp')
-rw-r--r--src/corelib/kernel/qobject.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 2a1391f1d52..7c179c4bde5 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -172,7 +172,7 @@ QObjectPrivate::QObjectPrivate(int version)
isDeletingChildren = false; // set by deleteChildren()
sendChildEvents = true; // if we should send ChildAdded and ChildRemoved events to parent
receiveChildEvents = true;
- postedEvents = 0;
+ postedEvents.storeRelaxed(0);
extraData = nullptr;
metaObject = nullptr;
isWindow = false;
@@ -200,7 +200,7 @@ QObjectPrivate::~QObjectPrivate()
}
}
- if (postedEvents)
+ if (postedEvents.loadRelaxed())
QCoreApplication::removePostedEvents(q_ptr, 0);
thisThreadData->deref();