[llvm-commits] [compiler-rt] r170116 - /compiler-rt/trunk/lib/tsan/rtl/tsan_mutex.cc
Dmitry Vyukov
dvyukov at google.com
Thu Dec 13 01:22:11 PST 2012
Author: dvyukov
Date: Thu Dec 13 03:22:11 2012
New Revision: 170116
URL: http://llvm.org/viewvc/llvm-project?rev=170116&view=rev
Log:
tsan: completely disable deadlock detector for Go
seems to cause some weird stack overflow
Modified:
compiler-rt/trunk/lib/tsan/rtl/tsan_mutex.cc
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_mutex.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_mutex.cc?rev=170116&r1=170115&r2=170116&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_mutex.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_mutex.cc Thu Dec 13 03:22:11 2012
@@ -25,6 +25,7 @@
// then Report mutex can be locked while under Threads mutex.
// The leaf mutexes can be locked under any other mutexes.
// Recursive locking is not supported.
+#if TSAN_DEBUG && !TSAN_GO
const MutexType MutexTypeLeaf = (MutexType)-1;
static MutexType CanLockTab[MutexTypeCount][MutexTypeCount] = {
/*0 MutexTypeInvalid*/ {},
@@ -40,8 +41,10 @@
};
static bool CanLockAdj[MutexTypeCount][MutexTypeCount];
+#endif
void InitializeMutex() {
+#if TSAN_DEBUG && !TSAN_GO
// Build the "can lock" adjacency matrix.
// If [i][j]==true, then one can lock mutex j while under mutex i.
const int N = MutexTypeCount;
@@ -115,12 +118,14 @@
Die();
}
}
+#endif
}
DeadlockDetector::DeadlockDetector() {
// Rely on zero initialization because some mutexes can be locked before ctor.
}
+#if TSAN_DEBUG && !TSAN_GO
void DeadlockDetector::Lock(MutexType t) {
// Printf("LOCK %d @%zu\n", t, seq_ + 1);
CHECK_GT(t, MutexTypeInvalid);
@@ -153,6 +158,7 @@
CHECK(locked_[t]);
locked_[t] = 0;
}
+#endif
const uptr kUnlocked = 0;
const uptr kWriteLock = 1;
More information about the llvm-commits
mailing list