mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-15 08:23:41 +00:00
runtime/scheduler: always update task state
Not updating it only saves 4 bytes and makes debugging harder.
This commit is contained in:
@@ -55,8 +55,7 @@ type taskState struct {
|
|||||||
next *coroutine
|
next *coroutine
|
||||||
}
|
}
|
||||||
|
|
||||||
// Various states a task can be in. Not always updated (especially
|
// Various states a task can be in.
|
||||||
// TASK_STATE_RUNNABLE).
|
|
||||||
const (
|
const (
|
||||||
TASK_STATE_RUNNABLE = iota
|
TASK_STATE_RUNNABLE = iota
|
||||||
TASK_STATE_SLEEP
|
TASK_STATE_SLEEP
|
||||||
@@ -218,6 +217,7 @@ func scheduler(main *coroutine) {
|
|||||||
promise := t.promise()
|
promise := t.promise()
|
||||||
sleepQueueBaseTime += uint64(promise.data)
|
sleepQueueBaseTime += uint64(promise.data)
|
||||||
sleepQueue = promise.next
|
sleepQueue = promise.next
|
||||||
|
promise.state = TASK_STATE_RUNNABLE
|
||||||
promise.next = nil
|
promise.next = nil
|
||||||
pushTask(t)
|
pushTask(t)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user