WaitableCondVar supports notify_one (#20013)

This commit is contained in:
Jeff Washington (jwash)
2021-09-20 09:57:57 -05:00
committed by GitHub
parent bc7983b13e
commit 55d9ff9899

View File

@ -15,6 +15,9 @@ impl WaitableCondvar {
pub fn notify_all(&self) {
self.event.notify_all();
}
pub fn notify_one(&self) {
self.event.notify_one();
}
pub fn wait_timeout(&self, timeout: Duration) -> bool {
let lock = self.mutex.lock().unwrap();
let res = self.event.wait_timeout(lock, timeout).unwrap();