diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-25 10:54:49 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-31 08:29:43 +0200 |
commit | 1b1be254e7a3e3d6fe6d55d62010a81a7ef35411 (patch) | |
tree | c8bacf15b0f092728fd69debcb2387b65db33ed0 /cpukit/posix/include/rtems/posix/pthreadimpl.h | |
parent | score: Replace _Thread_Reset() (diff) | |
download | rtems-1b1be254e7a3e3d6fe6d55d62010a81a7ef35411.tar.bz2 |
score: Thread life cycle re-implementation
The thread deletion is now supported on SMP.
This change fixes the following PRs:
PR1814: SMP race condition between stack free and dispatch
PR2035: psxcancel reveals NULL pointer access in _Thread_queue_Extract()
The POSIX cleanup handler are now called in the right context (should be
called in the context of the terminating thread).
http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_09.html
Add a user extension the reflects a thread termination event. This is
used to reclaim the Newlib reentrancy structure (may use file
operations), the POSIX cleanup handlers and the POSIX key destructors.
Diffstat (limited to 'cpukit/posix/include/rtems/posix/pthreadimpl.h')
-rw-r--r-- | cpukit/posix/include/rtems/posix/pthreadimpl.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cpukit/posix/include/rtems/posix/pthreadimpl.h b/cpukit/posix/include/rtems/posix/pthreadimpl.h index af68990d6b..02d8bca0f5 100644 --- a/cpukit/posix/include/rtems/posix/pthreadimpl.h +++ b/cpukit/posix/include/rtems/posix/pthreadimpl.h @@ -23,7 +23,7 @@ #include <rtems/posix/config.h> #include <rtems/posix/threadsup.h> #include <rtems/score/objectimpl.h> -#include <rtems/score/thread.h> +#include <rtems/score/threadimpl.h> #include <rtems/score/assert.h> #ifdef __cplusplus @@ -217,6 +217,8 @@ int rtems_pthread_attribute_compare( RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void ) { + _Thread_Kill_zombies(); + return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information ); } |