From efd8e75e00a786fd586e1e7b1139d9e1ef194ec0 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 27 Feb 2014 09:02:58 +0000 Subject: [PATCH] tsan: fix internal deadlock detector for external deadlock detector we must go deeper! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@202365 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/tsan/rtl/tsan_mutex.cc | 3 ++- lib/tsan/rtl/tsan_mutex.h | 2 +- lib/tsan/rtl/tsan_rtl.cc | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/tsan/rtl/tsan_mutex.cc b/lib/tsan/rtl/tsan_mutex.cc index 217c2f928..2c162082a 100644 --- a/lib/tsan/rtl/tsan_mutex.cc +++ b/lib/tsan/rtl/tsan_mutex.cc @@ -33,13 +33,14 @@ static MutexType CanLockTab[MutexTypeCount][MutexTypeCount] = { /*2 MutexTypeThreads*/ {MutexTypeReport}, /*3 MutexTypeReport*/ {MutexTypeSyncTab, MutexTypeSyncVar, MutexTypeMBlock, MutexTypeJavaMBlock}, - /*4 MutexTypeSyncVar*/ {}, + /*4 MutexTypeSyncVar*/ {MutexTypeDDetector}, /*5 MutexTypeSyncTab*/ {MutexTypeSyncVar}, /*6 MutexTypeSlab*/ {MutexTypeLeaf}, /*7 MutexTypeAnnotations*/ {}, /*8 MutexTypeAtExit*/ {MutexTypeSyncTab}, /*9 MutexTypeMBlock*/ {MutexTypeSyncVar}, /*10 MutexTypeJavaMBlock*/ {MutexTypeSyncVar}, + /*11 MutexTypeDDetector*/ {}, }; static bool CanLockAdj[MutexTypeCount][MutexTypeCount]; diff --git a/lib/tsan/rtl/tsan_mutex.h b/lib/tsan/rtl/tsan_mutex.h index 0cb0e5be4..12580fa9b 100644 --- a/lib/tsan/rtl/tsan_mutex.h +++ b/lib/tsan/rtl/tsan_mutex.h @@ -31,7 +31,7 @@ enum MutexType { MutexTypeAtExit, MutexTypeMBlock, MutexTypeJavaMBlock, - MutexTypeDeadlockDetector, + MutexTypeDDetector, // This must be the last. MutexTypeCount diff --git a/lib/tsan/rtl/tsan_rtl.cc b/lib/tsan/rtl/tsan_rtl.cc index 408423db2..5dd45fc65 100644 --- a/lib/tsan/rtl/tsan_rtl.cc +++ b/lib/tsan/rtl/tsan_rtl.cc @@ -83,7 +83,7 @@ Context::Context() , racy_stacks(MBlockRacyStacks) , racy_addresses(MBlockRacyAddresses) , fired_suppressions(8) - , dd_mtx(MutexTypeDeadlockDetector, StatMtxDeadlockDetector) { + , dd_mtx(MutexTypeDDetector, StatMtxDeadlockDetector) { dd.clear(); } -- 2.11.4.GIT