diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-12-11 10:47:22 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-02-03 10:00:54 +0100 |
commit | ef1a985fc7591988ef956dd7b35f9533bace68a6 (patch) | |
tree | 757f151efbbbe0bd0fffbe4d6cc6fa0e78799d96 /cpukit | |
parent | Optional POSIX Signals initialization (diff) | |
download | rtems-ef1a985fc7591988ef956dd7b35f9533bace68a6.tar.bz2 |
Optional POSIX Threads initialization
Update #2408.
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/posix/include/rtems/posix/pthreadimpl.h | 9 | ||||
-rw-r--r-- | cpukit/posix/src/killinfo.c | 12 | ||||
-rw-r--r-- | cpukit/posix/src/pthread.c | 11 | ||||
-rw-r--r-- | cpukit/sapi/src/posixapi.c | 2 | ||||
-rw-r--r-- | cpukit/score/include/rtems/sysinit.h | 1 |
5 files changed, 14 insertions, 21 deletions
diff --git a/cpukit/posix/include/rtems/posix/pthreadimpl.h b/cpukit/posix/include/rtems/posix/pthreadimpl.h index f95ac9cf94..9aff71c8f0 100644 --- a/cpukit/posix/include/rtems/posix/pthreadimpl.h +++ b/cpukit/posix/include/rtems/posix/pthreadimpl.h @@ -44,7 +44,7 @@ extern "C" { * The following defines the information control block used to manage * this class of objects. */ -POSIX_EXTERN Thread_Information _POSIX_Threads_Information; +extern Thread_Information _POSIX_Threads_Information; /** * This variable contains the default POSIX Thread attributes. @@ -61,13 +61,6 @@ extern pthread_attr_t _POSIX_Threads_Default_attributes; extern void (*_POSIX_Threads_Initialize_user_threads_p)(void); /** - * @brief POSIX threads manager initialization. - * - * This routine performs the initialization necessary for this manager. - */ -void _POSIX_Threads_Manager_initialization(void); - -/** * @brief Copy POSIX Thread attribute structure. * * This routine copies the attr2 thread attribute structure diff --git a/cpukit/posix/src/killinfo.c b/cpukit/posix/src/killinfo.c index 7f4adc738a..a29a8e6464 100644 --- a/cpukit/posix/src/killinfo.c +++ b/cpukit/posix/src/killinfo.c @@ -198,16 +198,8 @@ int killinfo( continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; - - #if defined(RTEMS_DEBUG) - /* - * This cannot happen in the current (as of June 2009) implementation - * of initialization but at some point, the object information - * structure for a particular manager may not be installed. - */ - if ( !the_info ) - continue; - #endif + if ( !the_info ) + continue; maximum = the_info->maximum; object_table = the_info->local_table; diff --git a/cpukit/posix/src/pthread.c b/cpukit/posix/src/pthread.c index ee7da11231..691dfc3161 100644 --- a/cpukit/posix/src/pthread.c +++ b/cpukit/posix/src/pthread.c @@ -26,6 +26,7 @@ #include <rtems/system.h> #include <rtems/config.h> +#include <rtems/sysinit.h> #include <rtems/score/apiext.h> #include <rtems/score/stack.h> #include <rtems/score/threadimpl.h> @@ -43,6 +44,8 @@ #include <rtems/score/cpusetimpl.h> #include <rtems/score/assert.h> +Thread_Information _POSIX_Threads_Information; + /* * The default pthreads attributes structure. * @@ -338,7 +341,7 @@ User_extensions_Control _POSIX_Threads_User_extensions = { * * This routine initializes all threads manager related data structures. */ -void _POSIX_Threads_Manager_initialization(void) +static void _POSIX_Threads_Manager_initialization(void) { #if defined(RTEMS_SMP) && defined(__RTEMS_HAVE_SYS_CPUSET_H__) const CPU_set_Control *affinity; @@ -381,3 +384,9 @@ void _POSIX_Threads_Manager_initialization(void) * Register the MP Process Packet routine. */ } + +RTEMS_SYSINIT_ITEM( + _POSIX_Threads_Manager_initialization, + RTEMS_SYSINIT_POSIX_THREADS, + RTEMS_SYSINIT_ORDER_MIDDLE +); diff --git a/cpukit/sapi/src/posixapi.c b/cpukit/sapi/src/posixapi.c index 1c54b77e5a..4cf5249bc4 100644 --- a/cpukit/sapi/src/posixapi.c +++ b/cpukit/sapi/src/posixapi.c @@ -38,7 +38,6 @@ #include <rtems/posix/muteximpl.h> #include <rtems/posix/priorityimpl.h> #include <rtems/posix/psignalimpl.h> -#include <rtems/posix/pthreadimpl.h> #include <rtems/posix/rwlockimpl.h> #include <rtems/posix/timerimpl.h> #include <rtems/posix/semaphoreimpl.h> @@ -64,7 +63,6 @@ void _POSIX_API_Initialize(void) _POSIX_Key_Manager_initialization(); #ifdef RTEMS_POSIX_API - _POSIX_Threads_Manager_initialization(); _POSIX_Condition_variables_Manager_initialization(); _POSIX_Mutex_Manager_initialization(); _POSIX_Message_queue_Manager_initialization(); diff --git a/cpukit/score/include/rtems/sysinit.h b/cpukit/score/include/rtems/sysinit.h index a6cb32f8c8..1da3b309ac 100644 --- a/cpukit/score/include/rtems/sysinit.h +++ b/cpukit/score/include/rtems/sysinit.h @@ -43,6 +43,7 @@ extern "C" { #define RTEMS_SYSINIT_CLASSIC_RATE_MONOTONIC 000349 #define RTEMS_SYSINIT_CLASSIC_BARRIER 00034a #define RTEMS_SYSINIT_POSIX_SIGNALS 000360 +#define RTEMS_SYSINIT_POSIX_THREADS 000361 #define RTEMS_SYSINIT_IDLE_THREADS 000380 #define RTEMS_SYSINIT_BSP_LIBC 000400 #define RTEMS_SYSINIT_BEFORE_DRIVERS 000500 |