Fix waitFor timeout behaviour

This commit is contained in:
2 changed files with 25 additions and 14 deletions

View File

@@ -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;
}
};