summaryrefslogtreecommitdiff
path: root/src/input/AsyncInputStream.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-05-07 20:01:45 +0200
committerMax Kellermann <max@musicpd.org>2019-05-07 20:01:45 +0200
commit973c87b351b31961a51b6ea9afc4bea0872565ad (patch)
treea47d7823474be76edb75d4ffc9f3fc1fe73e5f79 /src/input/AsyncInputStream.cxx
parent72fc117393b7b9cf34446ac6b990f344284c43a8 (diff)
event/Call, ...: use wait() with predicate
Diffstat (limited to 'src/input/AsyncInputStream.cxx')
-rw-r--r--src/input/AsyncInputStream.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/input/AsyncInputStream.cxx b/src/input/AsyncInputStream.cxx
index 3ccd41353..817922ecb 100644
--- a/src/input/AsyncInputStream.cxx
+++ b/src/input/AsyncInputStream.cxx
@@ -136,8 +136,8 @@ AsyncInputStream::Seek(std::unique_lock<Mutex> &lock,
CondInputStreamHandler cond_handler;
const ScopeExchangeInputStreamHandler h(*this, &cond_handler);
- while (seek_state != SeekState::NONE)
- cond_handler.cond.wait(lock);
+ cond_handler.cond.wait(lock,
+ [this]{ return seek_state == SeekState::NONE; });
Check();
}