forked from OSchip/llvm-project
[sanitizer] Pair atomic acquire with release in BlockingMutex::Unlock
Summary: Dmitry, seeking your expertise. I believe, the proper way to implement Lock/Unlock here would be to use acquire/release semantics. Am I missing something? Reviewers: dvyukov Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D33521 llvm-svn: 303869
This commit is contained in:
parent
fc50f62caa
commit
3ea9499e75
|
@ -549,7 +549,7 @@ void BlockingMutex::Lock() {
|
|||
|
||||
void BlockingMutex::Unlock() {
|
||||
atomic_uint32_t *m = reinterpret_cast<atomic_uint32_t *>(&opaque_storage_);
|
||||
u32 v = atomic_exchange(m, MtxUnlocked, memory_order_relaxed);
|
||||
u32 v = atomic_exchange(m, MtxUnlocked, memory_order_release);
|
||||
CHECK_NE(v, MtxUnlocked);
|
||||
if (v == MtxSleeping) {
|
||||
#if SANITIZER_FREEBSD
|
||||
|
|
Loading…
Reference in New Issue