forked from OSchip/llvm-project
tsan: completely disable deadlock detector for Go
seems to cause some weird stack overflow llvm-svn: 170116
This commit is contained in:
parent
5a26e1fbf2
commit
3533f76996
|
@ -25,6 +25,7 @@ namespace __tsan {
|
|||
// 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 MutexType CanLockTab[MutexTypeCount][MutexTypeCount] = {
|
|||
};
|
||||
|
||||
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 @@ void InitializeMutex() {
|
|||
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 @@ void DeadlockDetector::Unlock(MutexType t) {
|
|||
CHECK(locked_[t]);
|
||||
locked_[t] = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
const uptr kUnlocked = 0;
|
||||
const uptr kWriteLock = 1;
|
||||
|
|
Loading…
Reference in New Issue