diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-12 06:12:06 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-20 07:49:36 +0200 |
commit | b7f5e391c0c0e94e5958a294e5d38b1dda7332cc (patch) | |
tree | 6d48062b02d6ce9ba56b188be6e6ed1840a19a34 /cpukit/score/src/threadrestart.c | |
parent | score: Delete redundant thread life enums (diff) | |
download | rtems-b7f5e391c0c0e94e5958a294e5d38b1dda7332cc.tar.bz2 |
score: Add _Thread_Exit()
The goal is to make _Thread_Exit() a no-return function in follow up
patches.
Update #2555.
Update #2626.
Diffstat (limited to '')
-rw-r--r-- | cpukit/score/src/threadrestart.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/cpukit/score/src/threadrestart.c b/cpukit/score/src/threadrestart.c index ca054fab55..0184fd1532 100644 --- a/cpukit/score/src/threadrestart.c +++ b/cpukit/score/src/threadrestart.c @@ -341,14 +341,12 @@ static void _Thread_Request_life_change( void _Thread_Close( Thread_Control *the_thread, Thread_Control *executing ) { _Assert( _Thread_Is_life_protected( executing->Life.state ) ); + _Assert( the_thread != executing ); if ( _States_Is_dormant( the_thread->current_state ) ) { _Thread_Make_zombie( the_thread ); } else { - if ( - the_thread != executing - && !_Thread_Is_life_terminating( executing->Life.state ) - ) { + if ( !_Thread_Is_life_terminating( executing->Life.state ) ) { /* * Wait for termination of victim thread. If the executing thread is * also terminated, then do not wait. This avoids potential cyclic @@ -367,6 +365,18 @@ void _Thread_Close( Thread_Control *the_thread, Thread_Control *executing ) } } +void _Thread_Exit( Thread_Control *executing ) +{ + _Assert( _Thread_Is_life_protected( executing->Life.state ) ); + + _Thread_Request_life_change( + executing, + executing, + executing->current_priority, + THREAD_LIFE_TERMINATING + ); +} + bool _Thread_Restart( Thread_Control *the_thread, Thread_Control *executing, |