runtime/scheduler: always update task state

Not updating it only saves 4 bytes and makes debugging harder.
This commit is contained in:
Ayke van Laethem
2018-09-02 19:28:41 +02:00
parent d183f12395
commit 8ba3fef7d7
+2 -2
View File
@@ -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)
}