version 4.6.0

PIThreadNotifier::waitFor() new method
PIThread::waitForFinish() now use condvar to exit as soon as possible
This commit is contained in:
2025-01-15 17:57:16 +03:00
parent 60d2a83df5
commit 0dd47f50a0
6 changed files with 50 additions and 22 deletions

View File

@@ -115,6 +115,19 @@ void PIThreadNotifier::wait() {
}
bool PIThreadNotifier::waitFor(PISystemTime timeout) {
bool ret = false;
m.lock();
v.waitFor(m, timeout);
if (cnt > 0) {
cnt--;
ret = true;
}
m.unlock();
return ret;
}
//! \~\details
//! \~english
//! If many threads waiting, then notify randomly one.\n