diff --git a/tokio/src/runtime/io/scheduled_io.rs b/tokio/src/runtime/io/scheduled_io.rs index 550b7d495c2..6345bcc8835 100644 --- a/tokio/src/runtime/io/scheduled_io.rs +++ b/tokio/src/runtime/io/scheduled_io.rs @@ -222,7 +222,7 @@ impl ScheduledIo { let new_tick = match tick { Tick::Set => { let current = TICK.unpack(current); - current.wrapping_add(1) % TICK.max_value() + current.wrapping_add(1) % (TICK.max_value() + 1) } Tick::Clear(t) => { if TICK.unpack(current) as u8 != t {