forked from OSchip/llvm-project
[Support] Fix race in threading test, found by TSan
This commit is contained in:
parent
cb297050bb
commit
18e6a65bae
|
@ -32,8 +32,10 @@ public:
|
|||
{
|
||||
std::lock_guard<std::mutex> Lock(M);
|
||||
Notified = true;
|
||||
// Broadcast with the lock held, so it's safe to destroy the Notification
|
||||
// after wait() returns.
|
||||
CV.notify_all();
|
||||
}
|
||||
CV.notify_all();
|
||||
}
|
||||
|
||||
bool wait() {
|
||||
|
|
Loading…
Reference in New Issue