event/Call: use std::lock_guard

This commit is contained in:
Max Kellermann 2019-04-25 18:57:35 +02:00
parent f764925edc
commit 0e48747607

View File

@ -51,10 +51,11 @@ public:
defer_event.Schedule();
mutex.lock();
while (!done)
cond.wait(mutex);
mutex.unlock();
{
const std::lock_guard<Mutex> lock(mutex);
while (!done)
cond.wait(mutex);
}
if (exception)
std::rethrow_exception(exception);