[rtems commit] score: Remove thread timer earlier

Sebastian Huber sebh at rtems.org
Tue Nov 23 13:34:54 UTC 2021


Module:    rtems
Branch:    master
Commit:    cd791039b90211669f6688c782a1114d54932747
Changeset: http://git.rtems.org/rtems/commit/?id=cd791039b90211669f6688c782a1114d54932747

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Nov 11 08:33:36 2021 +0100

score: Remove thread timer earlier

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 15e141b..12a0329 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 );



More information about the vc mailing list