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 | 324947c49535971c87846c5f6b833be2a96d1812 (patch) | |
tree | 69d44288ea7ad6ecc99b1cefab11af2abeab5ad6 /lib | |
parent | 4fe3ea9ed0e80b3cd0fb7eed2f3d03c945c02aff (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@335322 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tsan/rtl/tsan_rtl_mutex.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/tsan/rtl/tsan_rtl_mutex.cc b/lib/tsan/rtl/tsan_rtl_mutex.cc index f0f4fbe7c..c61d02b7a 100644 --- a/lib/tsan/rtl/tsan_rtl_mutex.cc +++ b/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); } |