summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/pthreadexit.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-13 10:28:14 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-20 07:49:39 +0200
commitda82656065d09f7b6aa411ba361287afdd787204 (patch)
tree3a17cae7059c89d111642cb27a1cf55ded61f604 /cpukit/posix/src/pthreadexit.c
parentscore: Avoid Giant lock for _Thread_Start() (diff)
downloadrtems-da82656065d09f7b6aa411ba361287afdd787204.tar.bz2
posix: Rework thread cancellation
Add Thread_Life_state::THREAD_LIFE_CHANGE_DEFERRED and rework the POSIX thread cancellation to use the thread life states. Update #2555. Update #2626.
Diffstat (limited to 'cpukit/posix/src/pthreadexit.c')
-rw-r--r--cpukit/posix/src/pthreadexit.c29
1 files changed, 4 insertions, 25 deletions
diff --git a/cpukit/posix/src/pthreadexit.c b/cpukit/posix/src/pthreadexit.c
index 3c4d3ebaaf..53c42ff3d0 100644
--- a/cpukit/posix/src/pthreadexit.c
+++ b/cpukit/posix/src/pthreadexit.c
@@ -9,6 +9,8 @@
* COPYRIGHT (c) 1989-2011.
* On-Line Applications Research Corporation (OAR).
*
+ * Copyright (c) 2016 embedded brains GmbH.
+ *
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.org/license/LICENSE.
@@ -20,41 +22,18 @@
#include <pthread.h>
-#include <rtems/posix/pthreadimpl.h>
-#include <rtems/score/assert.h>
-#include <rtems/score/apimutex.h>
#include <rtems/score/threadimpl.h>
-#include <rtems/score/threadqimpl.h>
-void _POSIX_Thread_Exit(
- Thread_Control *the_thread,
- void *value_ptr
-)
+void pthread_exit( void *value_ptr )
{
Thread_Control *executing;
Per_CPU_Control *cpu_self;
- _Assert( _Debug_Is_thread_dispatching_allowed() );
-
cpu_self = _Thread_Dispatch_disable();
executing = _Per_CPU_Get_executing( cpu_self );
- /*
- * Now shut down the thread
- */
- if ( the_thread == executing ) {
- _Thread_Exit( executing, THREAD_LIFE_TERMINATING, value_ptr );
- } else {
- _Thread_Cancel( the_thread, executing, value_ptr );
- }
+ _Thread_Exit( executing, THREAD_LIFE_TERMINATING, value_ptr );
_Thread_Dispatch_enable( cpu_self );
-}
-
-void pthread_exit(
- void *value_ptr
-)
-{
- _POSIX_Thread_Exit( _Thread_Get_executing(), value_ptr );
RTEMS_UNREACHABLE();
}