From fbd08066af13beda4abdb25717f66d0a943fc5c8 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 7 Feb 2019 07:46:38 +0100 Subject: score: Fix plain priority thread queues (SMP) We must add/remove the priority queue to the FIFO of priority queues. --- cpukit/score/src/threadqops.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'cpukit/score/src') diff --git a/cpukit/score/src/threadqops.c b/cpukit/score/src/threadqops.c index 445fc4c835..dbabf9c8ac 100644 --- a/cpukit/score/src/threadqops.c +++ b/cpukit/score/src/threadqops.c @@ -360,6 +360,10 @@ static void _Thread_queue_Priority_priority_actions( switch ( priority_action_type ) { #if defined(RTEMS_SMP) case PRIORITY_ACTION_ADD: + if ( _Priority_Is_empty( &priority_queue->Queue ) ) { + _Chain_Append_unprotected( &heads->Heads.Fifo, &priority_queue->Node ); + } + _Priority_Plain_insert( &priority_queue->Queue, &scheduler_node->Wait.Priority.Node, @@ -371,6 +375,10 @@ static void _Thread_queue_Priority_priority_actions( &priority_queue->Queue, &scheduler_node->Wait.Priority.Node ); + + if ( _Priority_Is_empty( &priority_queue->Queue ) ) { + _Chain_Extract_unprotected( &priority_queue->Node ); + } break; #endif default: -- cgit v1.2.3