From 68c6ae154ca3b37610cd9450ebbfc3a849d36511 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 66ee6388..3da51184 100644 --- a/kernel/thread.c +++ b/kernel/thread.c @@ -1212,7 +1212,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;