llvm-project
1a53553f - [ORC] Fix synchronization in CoreAPIsTest. (#144556)

Commit
157 days ago
[ORC] Fix synchronization in CoreAPIsTest. (#144556) The code previously appeared to have a (benign?) race condition on `WorkThreads.size`, since it was being accessed outside of the mutex lock that protected it on the threads. This is usually okay since 1a1d6e6f98738be249b20994bcfed48dccac59e3, but doesn't seem reliable in general, so fix this code to express the intent more accurately. This instead relies on the same general principles as ref-counting, where each existing reference (thread) can add new references (threads) because they already have a reference themselves (until joined).
Author
Parents
Loading