[lsan] Don't crash on ThreadRegistry::threads_ data race
Comment "No lock needed" in CurrentThreadContext was wrong. Concurent ThreadRegistry::CreateThread can resize and relocate ThreadRegistry::threads_ the same time CurrentThreadContext reads it. To mitigate lock cost we store ThreadContext* instead of tid in THREADLOCAL cache, we can tid from the ThreadContext*. Reviewed By: kstoimenov, MaskRay Differential Revision: https://reviews.llvm.org/D148281
Loading
Please sign in to comment