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:
@@ -59,9 +59,9 @@ public:
|
||||
|
||||
private:
|
||||
bool LockWaitFinished() noexcept {
|
||||
const std::lock_guard<Mutex> protect(mutex);
|
||||
std::unique_lock<Mutex> lock(mutex);
|
||||
while (!finished)
|
||||
if (!cond.wait_for(mutex, timeout))
|
||||
if (!cond.wait_for(lock, timeout))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user