Use wrapping add on ticks to avoid tick counter overflow in debug builds (#101)

This commit is contained in:
James Liu 2024-02-21 20:03:49 -08:00 committed by GitHub
parent 7592d4188a
commit c7bbe489ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -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.