Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ harness = false
[dependencies]
async-lock = "2.6"
cfg-if = "1"
concurrent-queue = "2"
concurrent-queue = "2.2.0"
futures-lite = "1.11.0"
log = "0.4.11"
parking = "2.0.0"
Expand Down
14 changes: 7 additions & 7 deletions src/reactor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,17 +222,17 @@ impl Reactor {
fn process_timer_ops(&self, timers: &mut MutexGuard<'_, BTreeMap<(Instant, usize), Waker>>) {
// Process only as much as fits into the queue, or else this loop could in theory run
// forever.
for _ in 0..self.timer_ops.capacity().unwrap() {
match self.timer_ops.pop() {
Ok(TimerOp::Insert(when, id, waker)) => {
self.timer_ops
.try_iter()
.take(self.timer_ops.capacity().unwrap())
.for_each(|op| match op {
TimerOp::Insert(when, id, waker) => {
timers.insert((when, id), waker);
}
Ok(TimerOp::Remove(when, id)) => {
TimerOp::Remove(when, id) => {
timers.remove(&(when, id));
}
Err(_) => break,
}
}
});
}
}

Expand Down