[PATCH 1/6] score: Remove thread timer earlier

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Nov 15 17:08:55 UTC 2021


The earlier we remove the thread timer the less likely is a superfluous
thread timeout processing.

Update #4546.
---
 cpukit/score/src/threadrestart.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cpukit/score/src/threadrestart.c b/cpukit/score/src/threadrestart.c
index 15e141b51e..12a0329a73 100644
--- a/cpukit/score/src/threadrestart.c
+++ b/cpukit/score/src/threadrestart.c
@@ -137,8 +137,8 @@ static void _Thread_Make_zombie( Thread_Control *the_thread )
   _Objects_Close( &information->Objects, &the_thread->Object );
 
   _Thread_Set_state( the_thread, STATES_ZOMBIE );
-  _Thread_queue_Extract_with_proxy( the_thread );
   _Thread_Timer_remove( the_thread );
+  _Thread_queue_Extract_with_proxy( the_thread );
 
   /*
    * Add the thread to the thread zombie chain before we wake up joining
@@ -409,8 +409,8 @@ static void _Thread_Try_life_change_request(
     _Thread_Add_life_change_request( the_thread );
     _Thread_State_release( the_thread, lock_context );
 
-    _Thread_queue_Extract_with_proxy( the_thread );
     _Thread_Timer_remove( the_thread );
+    _Thread_queue_Extract_with_proxy( the_thread );
     _Thread_Remove_life_change_request( the_thread );
   } else {
     _Thread_Clear_state_locked( the_thread, STATES_SUSPENDED );
-- 
2.26.2



More information about the devel mailing list