diff options
author | Dmitry Vyukov <dvyukov@google.com> | 2012-07-28 15:27:41 +0000 |
---|---|---|
committer | Dmitry Vyukov <dvyukov@google.com> | 2012-07-28 15:27:41 +0000 |
commit | 9d150bdb433ddd092073dabd87ba15aa176603a1 (patch) | |
tree | 44f5c26c038875d940351c3a88a8cbd85740e9b3 /lib/tsan/rtl/tsan_rtl_mutex.cc | |
parent | 715c74611317d2e76f2b1dd854208eac238944ef (diff) | |
download | compiler-rt-9d150bdb433ddd092073dabd87ba15aa176603a1.tar.gz compiler-rt-9d150bdb433ddd092073dabd87ba15aa176603a1.tar.bz2 compiler-rt-9d150bdb433ddd092073dabd87ba15aa176603a1.tar.xz |
tsan: add ReleaseStore() function that merely copies vector clock rather than combines two clocks
fix clock setup for finalizer goroutine (Go runtime)
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@160918 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/tsan/rtl/tsan_rtl_mutex.cc')
-rw-r--r-- | lib/tsan/rtl/tsan_rtl_mutex.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/tsan/rtl/tsan_rtl_mutex.cc b/lib/tsan/rtl/tsan_rtl_mutex.cc index 959001ca..882def83 100644 --- a/lib/tsan/rtl/tsan_rtl_mutex.cc +++ b/lib/tsan/rtl/tsan_rtl_mutex.cc @@ -207,4 +207,14 @@ void Release(ThreadState *thr, uptr pc, uptr addr) { s->mtx.Unlock(); } +void ReleaseStore(ThreadState *thr, uptr pc, uptr addr) { + CHECK_GT(thr->in_rtl, 0); + DPrintf("#%d: ReleaseStore %zx\n", thr->tid, addr); + SyncVar *s = CTX()->synctab.GetAndLock(thr, pc, addr, true); + thr->clock.set(thr->tid, thr->fast_state.epoch()); + thr->clock.ReleaseStore(&s->clock); + StatInc(thr, StatSyncRelease); + s->mtx.Unlock(); +} + } // namespace __tsan |