version 4.6.0
PIThreadNotifier::waitFor() new method PIThread::waitForFinish() now use condvar to exit as soon as possible
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user