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.
This commit is contained in:
@@ -175,9 +175,9 @@ class DumpRemoteTagHandler final : public RemoteTagHandler {
|
||||
|
||||
public:
|
||||
Tag Wait() {
|
||||
const std::lock_guard<Mutex> lock(mutex);
|
||||
std::unique_lock<Mutex> lock(mutex);
|
||||
while (!done)
|
||||
cond.wait(mutex);
|
||||
cond.wait(lock);
|
||||
|
||||
if (error)
|
||||
std::rethrow_exception(error);
|
||||
|
Reference in New Issue
Block a user