diff --git a/src/runtime/scheduler.go b/src/runtime/scheduler.go index d65cd7e1..7dc2b790 100644 --- a/src/runtime/scheduler.go +++ b/src/runtime/scheduler.go @@ -226,10 +226,13 @@ func addSleepTask(t *task, duration int64) { // Run the scheduler until all tasks have finished. func scheduler() { // Main scheduler loop. + var now timeUnit for { scheduleLog("") scheduleLog(" schedule") - now := ticks() + if sleepQueue != nil { + now = ticks() + } // Add tasks that are done sleeping to the end of the runqueue so they // will be executed soon.