mirror of
https://github.com/intel/llvm.git
synced 2026-02-05 22:17:23 +08:00
tsan: serialize report printing in standalone deadlock detector
otherwise reports get intermixed llvm-svn: 206043
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -44,6 +44,7 @@ typedef AddrHashMap<Mutex, 31051> MutexHashMap;
|
||||
struct Context {
|
||||
DDetector *dd;
|
||||
|
||||
BlockingMutex report_mutex;
|
||||
MutexHashMap mutex_map;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user