mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 00:38:53 +08:00
io: use Condvar::wait_while
This commit is contained in:
parent
38d52b7835
commit
c6f7933999
|
@ -523,10 +523,8 @@ impl IoBuffer {
|
|||
let mut promise = self.fill_waiter.borrow_mut();
|
||||
let (mutex, condvar) = &**promise.as_ref().unwrap();
|
||||
{
|
||||
let mut done = mutex.lock().unwrap();
|
||||
while !*done {
|
||||
done = condvar.wait(done).unwrap();
|
||||
}
|
||||
let done_guard = mutex.lock().unwrap();
|
||||
let _done_guard = condvar.wait_while(done_guard, |done| !*done).unwrap();
|
||||
}
|
||||
*promise = None;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user