diff options
-rw-r--r-- | compiler-rt/lib/tsan/dd/dd_rtl.cc | 2 | ||||
-rw-r--r-- | compiler-rt/lib/tsan/dd/dd_rtl.h | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/compiler-rt/lib/tsan/dd/dd_rtl.cc b/compiler-rt/lib/tsan/dd/dd_rtl.cc index 7f3c75e946b..729e79e8d35 100644 --- a/compiler-rt/lib/tsan/dd/dd_rtl.cc +++ b/compiler-rt/lib/tsan/dd/dd_rtl.cc @@ -39,6 +39,7 @@ static void PrintStackTrace(Thread *thr, u32 stk) { static void ReportDeadlock(Thread *thr, DDReport *rep) { if (rep == 0) return; + BlockingMutexLock lock(&ctx->report_mutex); Printf("==============================\n"); Printf("WARNING: lock-order-inversion (potential deadlock)\n"); for (int i = 0; i < rep->n; i++) { @@ -52,7 +53,6 @@ static void ReportDeadlock(Thread *thr, DDReport *rep) { } } Printf("==============================\n"); - Die(); } Callback::Callback(Thread *thr) diff --git a/compiler-rt/lib/tsan/dd/dd_rtl.h b/compiler-rt/lib/tsan/dd/dd_rtl.h index 45d456e6615..ec777665d8f 100644 --- a/compiler-rt/lib/tsan/dd/dd_rtl.h +++ b/compiler-rt/lib/tsan/dd/dd_rtl.h @@ -44,6 +44,7 @@ typedef AddrHashMap<Mutex, 31051> MutexHashMap; struct Context { DDetector *dd; + BlockingMutex report_mutex; MutexHashMap mutex_map; }; |