From 31036f1dc8a963fb0bc3fc103f63028988314fea Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 18 Jul 2022 09:41:39 +0200 Subject: score: Use priority inheritance for thread join Threads may join the thread termination of another thread using the pthread_join() or rtems_task_delete() directives. The thread cancel operation used a special case priority boosting mechanism implemented by _Thread_Raise_real_priority(). The problem was that this approach * is not transitive, * does not account for priority adjustments of the calling task while waiting for the join, * does not support clustered scheduling, and * does not detect deadlocks. All these problems are fixed by using a priority inheritance thread queue for the join operation. Close #4679. --- testsuites/validation/tc-task-restart.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'testsuites/validation/tc-task-restart.c') diff --git a/testsuites/validation/tc-task-restart.c b/testsuites/validation/tc-task-restart.c index 1c7528e961..f6c3aabd33 100644 --- a/testsuites/validation/tc-task-restart.c +++ b/testsuites/validation/tc-task-restart.c @@ -1424,7 +1424,7 @@ static void RtemsTaskReqRestart_Post_State_Check( T_eq_ptr( event->thread, ctx->worker_tcb ); } - if ( !ctx->real_priority_is_initial ) { + if ( !ctx->real_priority_is_initial && !ctx->terminating ) { event = T_scheduler_next_any( &ctx->scheduler_log.header, &index ); T_eq_int( event->operation, T_SCHEDULER_UPDATE_PRIORITY ); T_eq_ptr( event->thread, ctx->worker_tcb ); @@ -1464,7 +1464,7 @@ static void RtemsTaskReqRestart_Post_State_Check( } } - if ( !ctx->real_priority_is_initial ) { + if ( !ctx->real_priority_is_initial && !ctx->terminating ) { event = T_scheduler_next_any( &ctx->scheduler_log.header, &index ); T_eq_int( event->operation, T_SCHEDULER_UPDATE_PRIORITY ); T_eq_ptr( event->thread, ctx->worker_tcb ); @@ -1504,7 +1504,7 @@ static void RtemsTaskReqRestart_Post_State_Check( } } - if ( !ctx->real_priority_is_initial ) { + if ( !ctx->real_priority_is_initial && !ctx->terminating ) { event = T_scheduler_next_any( &ctx->scheduler_log.header, &index ); T_eq_int( event->operation, T_SCHEDULER_UPDATE_PRIORITY ); T_eq_ptr( event->thread, ctx->worker_tcb ); -- cgit v1.2.3