Skip to content

Commit 6f686d1

Browse files
committed
runtime: don't access timer queue outside of lock
This was causing a flake on testing `context`. Fixes #5469
1 parent 6a0acfc commit 6f686d1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/runtime/scheduler_threads.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ func timerRunner() {
7979
// Using a futex, so that the wait is exited early when adding a new
8080
// (sooner-to-expire) timer.
8181
val := timerFutex.Load()
82-
timerQueueLock.Unlock()
8382
timeout := ticksToNanoseconds(timerQueue.whenTicks() - now)
83+
timerQueueLock.Unlock()
8484
timerFutex.WaitUntil(val, uint64(timeout))
8585
continue
8686
}

0 commit comments

Comments
 (0)