QReadWriteLock: fix data race on weakly-ordered memory architectures
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Thu, 18 Jun 2026 11:20:31 +0000 (14:20 +0300)
committerDmitry Shachnev <mitya57@debian.org>
Thu, 18 Jun 2026 11:20:31 +0000 (14:20 +0300)
commit64db633b80b9afd0e7f55b293374727d3c4e237f
treea9cf4ebbbcf89290ca695f98b19286760556cd89
parentfdd90bb6b18fa905dcaaf99f9fe2e4105d6fa796
QReadWriteLock: fix data race on weakly-ordered memory architectures

Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit?id=4fd88011fa7975ce
Last-Update: 2025-12-14

The fix changes the relaxed load of d_ptr in lockFor{Read,Write} after
the acquire of the mutex to an acquire load, to establish
synchronization with the release store of d_ptr when converting from an
uncontended lock to a contended lock.

Gbp-Pq: Name qreadwritelock_data_race_2.diff
src/corelib/thread/qreadwritelock.cpp
tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp