From a92989a8bd11bf225d61d500541b4eca693193c9 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 18 Jun 2014 15:16:02 +0200 Subject: score: Fix thread deletion on SMP Close the thread object in _Thread_Make_zombie() so that all blocking operations that use _Thread_Get() in the corresponding release directive can find a terminating thread and can complete the operation. --- cpukit/score/src/threadrestart.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'cpukit') diff --git a/cpukit/score/src/threadrestart.c b/cpukit/score/src/threadrestart.c index 92470e5e35..cc2d8c349f 100644 --- a/cpukit/score/src/threadrestart.c +++ b/cpukit/score/src/threadrestart.c @@ -55,6 +55,11 @@ static void _Thread_Make_zombie( Thread_Control *the_thread ) ); } + _Objects_Close( + _Objects_Get_information_id( the_thread->Object.id ), + &the_thread->Object + ); + _Thread_Set_state( the_thread, STATES_ZOMBIE ); _Thread_queue_Extract_with_proxy( the_thread ); _Watchdog_Remove( &the_thread->Timer ); @@ -282,11 +287,6 @@ void _Thread_Close( Thread_Control *the_thread, Thread_Control *executing ) { _Assert( _Thread_Is_life_protected( executing->Life.state ) ); - _Objects_Close( - _Objects_Get_information_id( the_thread->Object.id ), - &the_thread->Object - ); - if ( _States_Is_dormant( the_thread->current_state ) ) { _Thread_Make_zombie( the_thread ); } else { -- cgit v1.2.3