QReadWriteLock: fix another data race in stateForWaitCondition()
The writerCount member variable is only ever accessed under Private::mutex protection, so we need to lock the mutex here, too. Pick-to: 6.3 6.2 5.15 Change-Id: I1717e5282eed2ecc14ccdc5090b9fc41174cccc8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>bb10
parent
ff053b39a3
commit
0ca2cf42e0
|
|
@ -422,6 +422,7 @@ QReadWriteLock::StateForWaitCondition QReadWriteLock::stateForWaitCondition() co
|
|||
|
||||
if (!d)
|
||||
return Unlocked;
|
||||
const auto lock = qt_scoped_lock(d->mutex);
|
||||
if (d->writerCount > 1)
|
||||
return RecursivelyLocked;
|
||||
else if (d->writerCount == 1)
|
||||
|
|
|
|||
Loading…
Reference in New Issue