forked from OSchip/llvm-project
[perf] Fix a data race in the PerfJITEventListener
Concurrent JIT compilation + PerfJITEventListener triggers tsan error Reviewed By: cota Differential Revision: https://reviews.llvm.org/D104977
This commit is contained in:
parent
bd4bfe0e0c
commit
e88ac7295f
|
@ -284,6 +284,9 @@ void PerfJITEventListener::notifyObjectLoaded(
|
|||
NotifyCode(Name, *AddrOrErr, Size);
|
||||
}
|
||||
|
||||
// avoid races with writes
|
||||
std::lock_guard<sys::Mutex> Guard(Mutex);
|
||||
|
||||
Dumpstream->flush();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue