1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

[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:
Eugene Zhulenev 2021-06-26 07:34:43 -07:00
parent 785de491d5
commit 260c6f5e5f

View File

@ -284,6 +284,9 @@ void PerfJITEventListener::notifyObjectLoaded(
NotifyCode(Name, *AddrOrErr, Size); NotifyCode(Name, *AddrOrErr, Size);
} }
// avoid races with writes
std::lock_guard<sys::Mutex> Guard(Mutex);
Dumpstream->flush(); Dumpstream->flush();
} }