event/Call, ...: use wait() with predicate

This commit is contained in:
Max Kellermann
2019-05-07 20:01:45 +02:00
parent 72fc117393
commit 973c87b351
12 changed files with 20 additions and 35 deletions

View File

@@ -125,8 +125,7 @@ public:
void Wait() {
std::unique_lock<Mutex> lock(mutex);
while (!done)
cond.wait(lock);
cond.wait(lock, [this]{ return done; });
if (postponed_error)
std::rethrow_exception(postponed_error);