mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-10 05:53:39 +00:00
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:
committed by
Ron Evans
parent
db2a06a9bb
commit
e865db232b
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user