tsan: disable reporting of mutex misuses in Go
authorDmitry Vyukov <dvyukov@google.com>
Fri, 6 Jun 2014 17:23:27 +0000 (17:23 +0000)
committerDmitry Vyukov <dvyukov@google.com>
Fri, 6 Jun 2014 17:23:27 +0000 (17:23 +0000)
llvm-svn: 210353

compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc

index 6ab695d..efb41f5 100644 (file)
@@ -52,6 +52,10 @@ void DDMutexInit(ThreadState *thr, uptr pc, SyncVar *s) {
 
 static void ReportMutexMisuse(ThreadState *thr, uptr pc, ReportType typ,
     uptr addr, u64 mid) {
+  // In Go, these misuses are either impossible, or detected by std lib,
+  // or false positives (e.g. unlock in a different thread).
+  if (kGoMode)
+    return;
   ThreadRegistryLock l(ctx->thread_registry);
   ScopedReport rep(typ);
   rep.AddMutex(mid);