[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 55630191a3
commit 0fbf4f0211

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