WaitableCondVar supports notify_one (#20013)
This commit is contained in:
committed by
GitHub
parent
bc7983b13e
commit
55d9ff9899
@ -15,6 +15,9 @@ impl WaitableCondvar {
|
|||||||
pub fn notify_all(&self) {
|
pub fn notify_all(&self) {
|
||||||
self.event.notify_all();
|
self.event.notify_all();
|
||||||
}
|
}
|
||||||
|
pub fn notify_one(&self) {
|
||||||
|
self.event.notify_one();
|
||||||
|
}
|
||||||
pub fn wait_timeout(&self, timeout: Duration) -> bool {
|
pub fn wait_timeout(&self, timeout: Duration) -> bool {
|
||||||
let lock = self.mutex.lock().unwrap();
|
let lock = self.mutex.lock().unwrap();
|
||||||
let res = self.event.wait_timeout(lock, timeout).unwrap();
|
let res = self.event.wait_timeout(lock, timeout).unwrap();
|
||||||
|
Reference in New Issue
Block a user