Skip to content

Commit

Permalink
Use wrapping add on ticks to avoid tick counter overflow in debug bui…
Browse files Browse the repository at this point in the history
…lds (#101)
  • Loading branch information
james7132 authored Feb 22, 2024
1 parent 7592d41 commit c7bbe48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ impl Runner<'_> {
.await;

// Bump the tick counter.
self.ticks += 1;
self.ticks = self.ticks.wrapping_add(1);

if self.ticks % 64 == 0 {
// Steal tasks from the global queue to ensure fair task scheduling.
Expand Down

0 comments on commit c7bbe48

Please sign in to comment.