mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-04 11:07:46 +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
|
||||
}
|
||||
|
||||
// Various states a task can be in. Not always updated (especially
|
||||
// TASK_STATE_RUNNABLE).
|
||||
// Various states a task can be in.
|
||||
const (
|
||||
TASK_STATE_RUNNABLE = iota
|
||||
TASK_STATE_SLEEP
|
||||
@@ -218,6 +217,7 @@ func scheduler(main *coroutine) {
|
||||
promise := t.promise()
|
||||
sleepQueueBaseTime += uint64(promise.data)
|
||||
sleepQueue = promise.next
|
||||
promise.state = TASK_STATE_RUNNABLE
|
||||
promise.next = nil
|
||||
pushTask(t)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user