diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-10-06 10:07:38 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-10-09 14:52:58 +0200 |
commit | af9115f35cfb3d0adeb3e105fd608883596f2637 (patch) | |
tree | d6638dc66e87ad1736f7675f79e7e6d116e5c463 /cpukit/posix/src/pthread.c | |
parent | 65012bfebbc03088f0740b086abb26d2ff6ebd8b (diff) |
posix: Simplify POSIX_API_Control
Return stack area via pthread_getattr_np().
Simplify
* pthread_attr_setaffinity_np(), and
* pthread_attr_getaffinity_np()
and let the scheduler do the more sophisticated error checks.
Make
* pthread_setaffinity_np(),
* pthread_getaffinity_np(),
* pthread_attr_setaffinity_np(), and
* pthread_attr_getaffinity_np()
available in all configurations.
Update #2514.
Close #3145.
Close #3168.
Diffstat (limited to 'cpukit/posix/src/pthread.c')
-rw-r--r-- | cpukit/posix/src/pthread.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/cpukit/posix/src/pthread.c b/cpukit/posix/src/pthread.c index edbfa13121..1d791df7eb 100644 --- a/cpukit/posix/src/pthread.c +++ b/cpukit/posix/src/pthread.c @@ -75,9 +75,11 @@ pthread_attr_t _POSIX_Threads_Default_attributes = { .cputime_clock_allowed = 1, /* cputime_clock_allowed */ #endif .detachstate = PTHREAD_CREATE_JOINABLE, /* detachstate */ - .affinitysetsize = 0, - .affinityset = NULL, - .affinitysetpreallocated = {{0x0}} + .affinitysetsize = + sizeof( _POSIX_Threads_Default_attributes.affinitysetpreallocated ), + .affinityset = + &_POSIX_Threads_Default_attributes.affinitysetpreallocated, + .affinitysetpreallocated = {{0x1}} }; void _POSIX_Threads_Sporadic_timer( Watchdog_Control *watchdog ) @@ -166,8 +168,7 @@ static bool _POSIX_Threads_Create_extension( /* XXX check all fields are touched */ api->thread = created; - _POSIX_Threads_Initialize_attributes( &api->Attributes ); - api->Attributes.schedparam.sched_priority = _POSIX_Priority_From_core( + api->schedparam.sched_priority = _POSIX_Priority_From_core( _Thread_Scheduler_get_home( created ), _Thread_Get_priority( created ) ); @@ -203,7 +204,7 @@ static void _POSIX_Threads_Terminate_extension( Thread_Control *executing ) _Thread_State_acquire( executing, &lock_context ); - if ( api->Attributes.schedpolicy == SCHED_SPORADIC ) { + if ( api->schedpolicy == SCHED_SPORADIC ) { _Watchdog_Per_CPU_remove_relative( &api->Sporadic.Timer ); } |