Fix error based on retry queue

This commit is contained in:
Emil Fresk 2022-06-21 16:46:33 +02:00
parent 07bd57a20f
commit 4a349653b4
3 changed files with 12 additions and 10 deletions

View file

@ -162,7 +162,9 @@ where
let now = mono.now();
if instant <= now {
// Task became ready, wake the waker
self.waker_queue.pop().map(|v| v.val.waker.wake_by_ref());
if let Some(v) = self.waker_queue.pop() {
v.val.waker.wake_by_ref()
}
} else {
// Set compare
mono.set_compare(instant);
@ -172,7 +174,9 @@ where
// read of now to the set of the compare, the time can overflow. This is to
// guard against this.
if instant <= now {
self.waker_queue.pop().map(|v| v.val.waker.wake_by_ref());
if let Some(v) = self.waker_queue.pop() {
v.val.waker.wake_by_ref()
}
}
}
}