Fix waitFor timeout behaviour
This commit is contained in:
@@ -14,9 +14,7 @@ public:
|
||||
|
||||
void wait(PIMutex& lk, const std::function<bool()>& condition) override {
|
||||
isWaitCalled = true;
|
||||
lk.lock();
|
||||
isTrueCondition = condition();
|
||||
lk.unlock();
|
||||
}
|
||||
|
||||
bool waitFor(PIMutex& lk, int timeoutMs) override {
|
||||
@@ -27,10 +25,8 @@ public:
|
||||
|
||||
bool waitFor(PIMutex& lk, int timeoutMs, const std::function<bool()>& condition) override {
|
||||
isWaitForCalled = true;
|
||||
lk.lock();
|
||||
isTrueCondition = condition();
|
||||
timeout = timeoutMs;
|
||||
lk.unlock();
|
||||
return isTrueCondition;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user