[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:
Alex Shlyapnikov 2017-05-25 15:07:07 +00:00
parent fc50f62caa
commit 3ea9499e75
1 changed files with 1 additions and 1 deletions

View File

@ -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