[Support] Fix race in threading test, found by TSan

This commit is contained in:
Sam McCall 2020-01-25 15:22:12 +01:00
parent cb297050bb
commit 18e6a65bae
1 changed files with 3 additions and 1 deletions

View File

@ -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() {