diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-10-25 10:54:12 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-10-29 10:52:45 +0100 |
commit | 54f35888311f36baaefd90b1f31e4150e3db5465 (patch) | |
tree | 967692c3c0ae9e1570895b052a9f73441dc97256 /cpukit/posix/src/pthreadcreate.c | |
parent | posix: Hide POSIX_API_Control by default (diff) | |
download | rtems-54f35888311f36baaefd90b1f31e4150e3db5465.tar.bz2 |
posix: Provide threads by default
Update #2514.
Diffstat (limited to 'cpukit/posix/src/pthreadcreate.c')
-rw-r--r-- | cpukit/posix/src/pthreadcreate.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/cpukit/posix/src/pthreadcreate.c b/cpukit/posix/src/pthreadcreate.c index 46fe1e7412..39a241350f 100644 --- a/cpukit/posix/src/pthreadcreate.c +++ b/cpukit/posix/src/pthreadcreate.c @@ -62,10 +62,8 @@ int pthread_create( }; const pthread_attr_t *the_attr; int normal_prio; - int low_prio; bool valid; Priority_Control core_normal_prio; - Priority_Control core_low_prio; Thread_CPU_budget_algorithms budget_algorithm; Thread_CPU_budget_algorithm_callout budget_callout; bool is_fp; @@ -73,14 +71,18 @@ int pthread_create( Thread_Control *the_thread; Thread_Control *executing; const Scheduler_Control *scheduler; - POSIX_API_Control *api; - const POSIX_API_Control *executing_api; int schedpolicy = SCHED_RR; struct sched_param schedparam; size_t stacksize; Objects_Name name; int error; ISR_lock_Context lock_context; +#if defined(RTEMS_POSIX_API) + int low_prio; + Priority_Control core_low_prio; + POSIX_API_Control *api; + const POSIX_API_Control *executing_api; +#endif if ( !start_routine ) return EFAULT; @@ -167,6 +169,7 @@ int pthread_create( return EINVAL; } +#if defined(RTEMS_POSIX_API) if ( schedpolicy == SCHED_SPORADIC ) { low_prio = schedparam.sched_ss_low_priority; } else { @@ -177,6 +180,7 @@ int pthread_create( if ( !valid ) { return EINVAL; } +#endif if ( the_attr->affinityset == NULL ) { return EINVAL; @@ -242,6 +246,10 @@ int pthread_create( return EINVAL; } + the_thread->was_created_with_inherited_scheduler = + ( the_attr->inheritsched == PTHREAD_INHERIT_SCHED ); + +#if defined(RTEMS_POSIX_API) /* * finish initializing the per API structure */ @@ -250,9 +258,6 @@ int pthread_create( api->signals_unblocked = executing_api->signals_unblocked; - the_thread->was_created_with_inherited_scheduler = - ( the_attr->inheritsched == PTHREAD_INHERIT_SCHED ); - _Priority_Node_set_priority( &api->Sporadic.Low_priority, core_low_prio ); api->Sporadic.sched_ss_repl_period = the_attr->schedparam.sched_ss_repl_period; @@ -264,6 +269,7 @@ int pthread_create( if ( schedpolicy == SCHED_SPORADIC ) { _POSIX_Threads_Sporadic_timer( &api->Sporadic.Timer ); } +#endif /* * POSIX threads are allocated and started in one operation. |