merged concurrent to main library

removed PIConditionLock, use PIMutex instead
This commit is contained in:
2020-07-30 18:50:42 +03:00
parent 4dd59132d5
commit 2ffc457566
31 changed files with 558 additions and 2176 deletions

View File

@@ -8,24 +8,24 @@ public:
bool isTrueCondition = false;
int timeout = -1;
void wait(PIConditionLock& lk) override {
void wait(PIMutex& lk) override {
isWaitCalled = true;
}
void wait(PIConditionLock& lk, const std::function<bool()>& condition) override {
void wait(PIMutex& lk, const std::function<bool()>& condition) override {
isWaitCalled = true;
lk.lock();
isTrueCondition = condition();
lk.unlock();
}
bool waitFor(PIConditionLock& lk, int timeoutMs) override {
bool waitFor(PIMutex& lk, int timeoutMs) override {
isWaitForCalled = true;
timeout = timeoutMs;
return false;
}
bool waitFor(PIConditionLock& lk, int timeoutMs, const std::function<bool()>& condition) override {
bool waitFor(PIMutex& lk, int timeoutMs, const std::function<bool()>& condition) override {
isWaitForCalled = true;
lk.lock();
isTrueCondition = condition();