thread/*Cond: add wait_for() overload with predicate
This commit is contained in:
@@ -60,11 +60,7 @@ public:
|
||||
private:
|
||||
bool LockWaitFinished() noexcept {
|
||||
std::unique_lock<Mutex> lock(mutex);
|
||||
while (!finished)
|
||||
if (!cond.wait_for(lock, timeout))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
return cond.wait_for(lock, timeout, [this]{ return finished; });
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user