diff options
author | Dmitry Vyukov <dvyukov@google.com> | 2018-06-22 08:27:52 +0000 |
---|---|---|
committer | Dmitry Vyukov <dvyukov@google.com> | 2018-06-22 08:27:52 +0000 |
commit | ac5fa6605c8ee539bf61075b5851d87bca413c4c (patch) | |
tree | 7b887f9e20133c80dd0295683fcf967208e167e6 | |
parent | 032db94ac9eac2d18d1889672853e7e69b639c4d (diff) | |
download | bcm5719-llvm-ac5fa6605c8ee539bf61075b5851d87bca413c4c.tar.gz bcm5719-llvm-ac5fa6605c8ee539bf61075b5851d87bca413c4c.zip |
tsan: fix deficiency in MutexReadOrWriteUnlock
MutexUnlock uses ReleaseStore on s->clock, which is the right thing to do.
However MutexReadOrWriteUnlock for writers uses Release on s->clock.
Make MutexReadOrWriteUnlock also use ReleaseStore for consistency and performance.
Unfortunately, I don't think any test can detect this as this only potentially
affects performance.
llvm-svn: 335322
-rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc b/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc index f0f4fbe7c7c..c61d02b7a76 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc @@ -361,7 +361,7 @@ void MutexReadOrWriteUnlock(ThreadState *thr, uptr pc, uptr addr) { if (s->recursion == 0) { StatInc(thr, StatMutexUnlock); s->owner_tid = SyncVar::kInvalidTid; - ReleaseImpl(thr, pc, &s->clock); + ReleaseStoreImpl(thr, pc, &s->clock); } else { StatInc(thr, StatMutexRecUnlock); } |