mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-03 02:27:48 +00:00
runtime: don't access timer queue outside of lock
This was causing a flake on testing `context`. Fixes #5469
This commit is contained in:
committed by
Damian Gryski
parent
6a0acfc735
commit
6f686d12af
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user