runtime: implement timers for Go 1.23

There were a number of changes in time.Timer/time.Ticker that need a
separate implementation for Go 1.22 and Go 1.23.
This commit is contained in:
Ayke van Laethem
2024-06-24 16:19:07 +02:00
committed by Ron Evans
parent db2a06a9bb
commit e865db232b
4 changed files with 105 additions and 28 deletions
+2 -1
View File
@@ -181,12 +181,13 @@ func scheduler() {
// Check for expired timers to trigger.
if timerQueue != nil && now >= timerQueue.whenTicks() {
scheduleLog("--- timer awoke")
delay := ticksToNanoseconds(now - timerQueue.whenTicks())
// Pop timer from queue.
tn := timerQueue
timerQueue = tn.next
tn.next = nil
// Run the callback stored in this timer node.
tn.callback(tn)
tn.callback(tn, delay)
}
t := runqueue.Pop()