Skip to content

Commit

Permalink
[perf] Fix a data race in the PerfJITEventListener
Browse files Browse the repository at this point in the history
Concurrent JIT compilation + PerfJITEventListener triggers tsan error

Reviewed By: cota

Differential Revision: https://reviews.llvm.org/D104977
  • Loading branch information
ezhulenev committed Jun 29, 2021
1 parent bd4bfe0 commit e88ac72
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -284,6 +284,9 @@ void PerfJITEventListener::notifyObjectLoaded(
NotifyCode(Name, *AddrOrErr, Size);
}

// avoid races with writes
std::lock_guard<sys::Mutex> Guard(Mutex);

Dumpstream->flush();
}

Expand Down

0 comments on commit e88ac72

Please sign in to comment.