[PATCH] D40294: Prevent Thread Exited/Joined events race

Kamil Rytarowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 21 19:14:46 PST 2017


krytarowski added inline comments.


================
Comment at: lib/sanitizer_common/sanitizer_thread_registry.cc:87
 void ThreadContextBase::Reset() {
   status = ThreadStatusInvalid;
   SetName(0);
----------------
krytarowski wrote:
> dvyukov wrote:
> > This also needs to reset thread_destroyed because contexts are reused.
> I see, this might be the reason why I observed the races!
I've confirmed that after resetting `thread_destroyed` in `Reset()` there are no longer races.

I'm going to revamp the patch now.


Repository:
  rL LLVM

https://reviews.llvm.org/D40294





More information about the llvm-commits mailing list