diff options
| author | Thiago Macieira <thiago.macieira@intel.com> | 2024-11-13 12:56:24 -0800 |
|---|---|---|
| committer | Thiago Macieira <thiago.macieira@intel.com> | 2024-12-05 13:04:46 -0800 |
| commit | d7c9619a815af74a988770c2d2e5d1116f2769fb (patch) | |
| tree | 278ef739fe117909a85f04cf7b5973f6bbace6de /src/corelib/thread/qthread.cpp | |
| parent | 083e44318cb481180357a0a27a3d93a85242cff3 (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/thread/qthread.cpp')
| -rw-r--r-- | src/corelib/thread/qthread.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp index 61294deee25..5af1787fb11 100644 --- a/src/corelib/thread/qthread.cpp +++ b/src/corelib/thread/qthread.cpp @@ -68,7 +68,7 @@ QThreadData::~QThreadData() for (qsizetype i = 0; i < postEventList.size(); ++i) { const QPostEvent &pe = postEventList.at(i); if (pe.event) { - --pe.receiver->d_func()->postedEvents; + pe.receiver->d_func()->postedEvents.fetchAndSubRelaxed(1); pe.event->m_posted = false; delete pe.event; } |
