diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2017-02-16 10:27:35 +0100 |
---|---|---|
committer | Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> | 2017-02-17 16:21:20 +0000 |
commit | 8d6d68d3d363bb6aa1faec2355b32e3ea290116c (patch) | |
tree | d9953161ade88bd394cf7a370d0c267b4d740f0b /examples/opengl | |
parent | 6f64bfa654fb7e20bb75ec3b0544b81482babb44 (diff) |
QReadWriteLocker: Fix race in unlock
An Acquire barrier in QReadWriteLocker::unlock was missing to synchronize
with the testAndSetOrdered on d_ptr in the lock functions.
The race is between the write of d->writerCount in tryLockForWrite,
and the read in unlock. The acquire on d->mutex is not enough because
it is not on the same object. While that race could be fixed by taking
the newly-allocate()ed d's mutex before publishing it with testAndSet,
there's another race, on 'recursive', between a newly-minted Private*
with recursive == false in tryLockForWrite(), and the read of 'recursive'
in unlock().
Task-number: QTBUG-58917
Change-Id: I10ba36573c0e57468d11e9b77d85045711feaea1
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'examples/opengl')
0 files changed, 0 insertions, 0 deletions