mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-25 02:13:24 +00:00
Add wait_until_* functionality to Waiter
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
6a5a5b4d3d
commit
1873bb7a3f
@ -164,8 +164,8 @@ impl Condvar {
|
||||
// Wait until the condition becomes true, we're explicitly woken up, or the timeout elapses.
|
||||
let res = self.waitqueue.wait_until_or_timeout(cond, &timeout);
|
||||
match res {
|
||||
Some(_) => Ok((lock.lock(), false)),
|
||||
None => {
|
||||
Ok(()) => Ok((lock.lock(), false)),
|
||||
Err(_) => {
|
||||
let mut counter = self.counter.lock();
|
||||
counter.waiter_count -= 1;
|
||||
Err(LockErr::Timeout((lock.lock(), true)))
|
||||
|
Reference in New Issue
Block a user