diff options
author | Max Kellermann <max@musicpd.org> | 2019-04-25 18:53:38 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2019-04-26 11:51:45 +0200 |
commit | 92022658f902dcfd647de556bc764469e66694f0 (patch) | |
tree | 12197d5759a2f6ed59b38bb92c61e2759a8e785b /src/input/Open.cxx | |
parent | b51bae5500f8c9cc37708ca5130c9ee9866a0704 (diff) |
thread/Cond: add wait() overload which takes a unique_lock<>
Just like std::condition_variable, which however has no way to specify
the std::mutex directly.
Diffstat (limited to 'src/input/Open.cxx')
-rw-r--r-- | src/input/Open.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/input/Open.cxx b/src/input/Open.cxx index 1c948f8f3..8ac6d868e 100644 --- a/src/input/Open.cxx +++ b/src/input/Open.cxx @@ -57,14 +57,14 @@ InputStream::OpenReady(const char *uri, Mutex &mutex) is->SetHandler(&handler); { - const std::lock_guard<Mutex> protect(mutex); + std::unique_lock<Mutex> lock(mutex); while (true) { is->Update(); if (is->IsReady()) break; - handler.cond.wait(mutex); + handler.cond.wait(lock); } is->Check(); |