summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/threadrestart.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-06-18 15:16:02 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-06-23 09:54:05 +0200
commita92989a8bd11bf225d61d500541b4eca693193c9 (patch)
tree84080564a4a44eeac01f201de62d0f4da6f40382 /cpukit/score/src/threadrestart.c
parentscore: Decouple thread and scheduler nodes on SMP (diff)
downloadrtems-a92989a8bd11bf225d61d500541b4eca693193c9.tar.bz2
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.
Diffstat (limited to 'cpukit/score/src/threadrestart.c')
-rw-r--r--cpukit/score/src/threadrestart.c10
1 files changed, 5 insertions, 5 deletions
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 {