[compiler-rt] r210358 - tsan: fix mutex in Go mode
Dmitry Vyukov
dvyukov at google.com
Fri Jun 6 11:04:05 PDT 2014
Author: dvyukov
Date: Fri Jun 6 13:04:05 2014
New Revision: 210358
URL: http://llvm.org/viewvc/llvm-project?rev=210358&view=rev
Log:
tsan: fix mutex in Go mode
In Go it's legal to unlock from a different goroutine.
Modified:
compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_mutex.cc
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_mutex.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_mutex.cc?rev=210358&r1=210357&r2=210358&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_mutex.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_mutex.cc Fri Jun 6 13:04:05 2014
@@ -198,7 +198,7 @@ int MutexUnlock(ThreadState *thr, uptr p
TraceAddEvent(thr, thr->fast_state, EventTypeUnlock, s->GetId());
int rec = 0;
bool report_bad_unlock = false;
- if (s->recursion == 0 || s->owner_tid != thr->tid) {
+ if (kCppMode && (s->recursion == 0 || s->owner_tid != thr->tid)) {
if (flags()->report_mutex_bugs && !s->is_broken) {
s->is_broken = true;
report_bad_unlock = true;
More information about the llvm-commits
mailing list