diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2019-05-16 18:09:55 +0200 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2019-05-22 21:04:30 +0000 |
commit | 59937de098dd86472e73146bd0c84e980022e24d (patch) | |
tree | 005a5ba3793dce8be8e241bf7e51d7553e53423e /tests/auto/widgets | |
parent | eae4668afaaed2723383d8c19858d3e212f3e8ec (diff) |
Annotate the futex implementation for TSAN
TSAN does not understand the futex system call.
Now, in QMutex and QSemaphore usage, futex is always wrapped by
atomic operations that always do an acquire (before waiting) and
a release (before waking waiters). That alone realizes a
synchronizes-with, and since Qt uses std::atomics, TSAN knows
what's going on and does not complain.
But what if one uses futex directly, or we change the
algorithms, or introduce some other new synchronization
primitive somewhere? Luckily TSAN offers annotations for this
that we can use.
This patch annotates the main entry point for the futex syscall
with a pair of acquire/release semantics. A futex call
guarantees total ordering on the operations on the futex
word(s), whether the call succeeds or fails.
Change-Id: Ib80ff898c09fbb6fc73989247eb757bf70971a8a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/widgets')
0 files changed, 0 insertions, 0 deletions