QReadWriteLock: fix data race on weakly-ordered memory architectures
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Tue, 5 May 2026 13:51:20 +0000 (16:51 +0300)
committerDmitry Shachnev <mitya57@debian.org>
Tue, 5 May 2026 13:51:20 +0000 (16:51 +0300)
commitd62858d49c6a041bbe393d0c03fefdf48bcfe4c6
tree13effb7913d521331d5c21e60ba4c5559d3ed644
parentd07d5c319050891f2c877ca31b78eb2bca39ed65
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