From 2f1119f95ce24e4193a2bdd475dd22e40df75f26 Mon Sep 17 00:00:00 2001 From: Damian Gryski Date: Fri, 19 Jun 2026 10:51:17 -0700 Subject: [PATCH] runtime: don't access timer queue outside of lock This was causing a flake on testing `context`. Fixes #5469 --- src/runtime/scheduler_threads.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/scheduler_threads.go b/src/runtime/scheduler_threads.go index ef53918d01..5eed9f2486 100644 --- a/src/runtime/scheduler_threads.go +++ b/src/runtime/scheduler_threads.go @@ -79,8 +79,8 @@ func timerRunner() { // Using a futex, so that the wait is exited early when adding a new // (sooner-to-expire) timer. val := timerFutex.Load() - timerQueueLock.Unlock() timeout := ticksToNanoseconds(timerQueue.whenTicks() - now) + timerQueueLock.Unlock() timerFutex.WaitUntil(val, uint64(timeout)) continue }