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/posix/src/pthreadexit.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 'cpukit/posix/src/pthreadexit.c')
-rw-r--r-- | cpukit/posix/src/pthreadexit.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cpukit/posix/src/pthreadexit.c b/cpukit/posix/src/pthreadexit.c index e2ae806654..940fa381c1 100644 --- a/cpukit/posix/src/pthreadexit.c +++ b/cpukit/posix/src/pthreadexit.c @@ -31,6 +31,7 @@ void _POSIX_Thread_Exit( void *value_ptr ) { + Thread_Control *executing; Thread_Control *unblocked; POSIX_API_Control *api; bool previous_life_protection; @@ -61,10 +62,16 @@ void _POSIX_Thread_Exit( } } + executing = _Thread_Executing; + /* * Now shut down the thread */ - _Thread_Close( the_thread, _Thread_Executing ); + if ( the_thread == executing ) { + _Thread_Exit( executing ); + } else { + _Thread_Close( the_thread, executing ); + } _Thread_Enable_dispatch(); _Thread_Set_life_protection( previous_life_protection ); |