Do not run timer queue if no alarm is set.

This commit is contained in:
Dario Nieuwenhuis 2020-12-29 00:04:58 +01:00
parent 267ec334ac
commit b01a88a839

View File

@ -214,9 +214,11 @@ impl Executor {
/// Runs the executor until the queue is empty. /// Runs the executor until the queue is empty.
pub fn run(&self) { pub fn run(&self) {
unsafe { unsafe {
self.timer_queue.dequeue_expired(Instant::now(), |p| { if self.alarm.is_some() {
self.enqueue(p); self.timer_queue.dequeue_expired(Instant::now(), |p| {
}); self.enqueue(p);
});
}
self.run_queue.dequeue_all(|p| { self.run_queue.dequeue_all(|p| {
let header = &*p; let header = &*p;