From 373afe2e528f9af1083e9428ac063b7a5f9004cf Mon Sep 17 00:00:00 2001 From: Mahavir Jain Date: Tue, 6 Sep 2016 23:06:16 +0530 Subject: [PATCH] [wait-queue] fix wake all to remove threads from tail While waking up all threads from wait-queue, order should start from tail to maintain correct scheduling sequence. Signed-off-by: Mahavir Jain --- kernel/thread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/thread.c b/kernel/thread.c index ea179449d..cd521f3c5 100644 --- a/kernel/thread.c +++ b/kernel/thread.c @@ -1217,7 +1217,7 @@ int wait_queue_wake_all(wait_queue_t *wait, bool reschedule, status_t wait_queue } /* pop all the threads off the wait queue into the run queue */ - while ((t = list_remove_head_type(&wait->list, thread_t, queue_node))) { + while ((t = list_remove_tail_type(&wait->list, thread_t, queue_node))) { wait->count--; DEBUG_ASSERT(t->state == THREAD_BLOCKED); t->state = THREAD_READY;