summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/pthreadexit.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-12 06:12:06 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-20 07:49:36 +0200
commitb7f5e391c0c0e94e5958a294e5d38b1dda7332cc (patch)
tree6d48062b02d6ce9ba56b188be6e6ed1840a19a34 /cpukit/posix/src/pthreadexit.c
parentscore: Delete redundant thread life enums (diff)
downloadrtems-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.c9
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 );