diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-12-11 11:09:13 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-12-15 07:41:34 +0100 |
commit | 54c3fbd63ec79d0986ecfacb9a37eb5a6fe3d264 (patch) | |
tree | 506dcbae4cd83d0d430b2e907564ffd55b0434eb /cpukit/posix/src | |
parent | af418e8f6b76a14a1d543d79fc79aa469f06b47d (diff) |
score: Initialize thread control to zero
This reduces the code size of the thread initialization.
Diffstat (limited to 'cpukit/posix/src')
-rw-r--r-- | cpukit/posix/src/pthread.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/cpukit/posix/src/pthread.c b/cpukit/posix/src/pthread.c index 5ba2691f2c..b8721f9f3c 100644 --- a/cpukit/posix/src/pthread.c +++ b/cpukit/posix/src/pthread.c @@ -206,10 +206,8 @@ static bool _POSIX_Threads_Create_extension( /* * POSIX 1003.1 1996, 18.2.2.2 */ - api->cancelation_requested = 0; - api->cancelability_state = PTHREAD_CANCEL_ENABLE; - api->cancelability_type = PTHREAD_CANCEL_DEFERRED; - api->last_cleanup_context = NULL; + RTEMS_STATIC_ASSERT( PTHREAD_CANCEL_ENABLE == 0, cancelability_state ); + RTEMS_STATIC_ASSERT( PTHREAD_CANCEL_DEFERRED == 0, cancelability_type ); /* * If the thread is not a posix thread, then all posix signals are blocked @@ -217,7 +215,7 @@ static bool _POSIX_Threads_Create_extension( * * The check for class == 1 is debug. Should never really happen. */ - api->signals_pending = SIGNAL_EMPTY_MASK; + RTEMS_STATIC_ASSERT( SIGNAL_EMPTY_MASK == 0, signals_pending ); if ( _Objects_Get_API( created->Object.id ) == OBJECTS_POSIX_API #if defined(RTEMS_DEBUG) && _Objects_Get_class( created->Object.id ) == 1 @@ -229,10 +227,8 @@ static bool _POSIX_Threads_Create_extension( api->signals_blocked = SIGNAL_ALL_MASK; } - _Thread_Action_initialize( &api->Signal_action ); _Thread_queue_Initialize( &api->Join_List, THREAD_QUEUE_DISCIPLINE_FIFO ); - _Watchdog_Preinitialize( &api->Sporadic_timer ); _Watchdog_Initialize( &api->Sporadic_timer, _POSIX_Threads_Sporadic_budget_TSR, |