[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 <mahavirpj@gmail.com>
This commit is contained in:
Mahavir Jain
2016-09-06 23:06:16 +05:30
committed by Travis Geiselbrecht
parent 014de968e1
commit 68c6ae154c

View File

@@ -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 */ /* 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--; wait->count--;
DEBUG_ASSERT(t->state == THREAD_BLOCKED); DEBUG_ASSERT(t->state == THREAD_BLOCKED);
t->state = THREAD_READY; t->state = THREAD_READY;