From 8ba3fef7d737f0f00ad13cbb1a3d4418ba2dcdb4 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Sun, 2 Sep 2018 19:28:41 +0200 Subject: [PATCH] runtime/scheduler: always update task state Not updating it only saves 4 bytes and makes debugging harder. --- src/runtime/scheduler.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/scheduler.go b/src/runtime/scheduler.go index d03d92b3..74c7991c 100644 --- a/src/runtime/scheduler.go +++ b/src/runtime/scheduler.go @@ -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) }