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

@@ -84,8 +84,7 @@ BufferedInputStream::Seek(std::unique_lock<Mutex> &lock,
seek = true;
wake_cond.notify_one();
while (seek)
client_cond.wait(lock);
client_cond.wait(lock, [this]{ return !seek; });
if (seek_error)
std::rethrow_exception(std::exchange(seek_error, {}));