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/event/Call.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/event/Call.cxx')
-rw-r--r-- | src/event/Call.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/event/Call.cxx b/src/event/Call.cxx index 78d1e645d..2711c1190 100644 --- a/src/event/Call.cxx +++ b/src/event/Call.cxx @@ -52,9 +52,9 @@ public: defer_event.Schedule(); { - const std::lock_guard<Mutex> lock(mutex); + std::unique_lock<Mutex> lock(mutex); while (!done) - cond.wait(mutex); + cond.wait(lock); } if (exception) |