summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-10-17 10:06:08 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-10-17 10:12:10 +0200
commit2fcea4c47325578d887d2c061a86e5e178d7a32a (patch)
treef779f8268a4a25365d4509ba082ab9f1204b2c2b /cpukit
parentscore: Rename _Watchdog_Per_CPU_insert_monotonic() (diff)
downloadrtems-2fcea4c47325578d887d2c061a86e5e178d7a32a.tar.bz2
posix: Fix _POSIX_Threads_Create_extension()
The thread POSIX API control must be fully initialized in _POSIX_Threads_Create_extension(), otherwise a pthread_setschedparam() is broken for all threads not created with pthread_create().
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/posix/src/pthread.c1
-rw-r--r--cpukit/posix/src/pthreadcreate.c3
2 files changed, 2 insertions, 2 deletions
diff --git a/cpukit/posix/src/pthread.c b/cpukit/posix/src/pthread.c
index 30b830cd85..9d1c1ad012 100644
--- a/cpukit/posix/src/pthread.c
+++ b/cpukit/posix/src/pthread.c
@@ -151,6 +151,7 @@ static bool _POSIX_Threads_Create_extension(
_Watchdog_Preinitialize( &api->Sporadic.Timer, _Per_CPU_Get_by_index( 0 ) );
_Watchdog_Initialize( &api->Sporadic.Timer, _POSIX_Threads_Sporadic_timer );
+ _Priority_Node_set_inactive( &api->Sporadic.Low_priority );
return true;
}
diff --git a/cpukit/posix/src/pthreadcreate.c b/cpukit/posix/src/pthreadcreate.c
index 75205f7e0a..d8cafe52ce 100644
--- a/cpukit/posix/src/pthreadcreate.c
+++ b/cpukit/posix/src/pthreadcreate.c
@@ -242,8 +242,7 @@ int pthread_create(
( the_attr->inheritsched == PTHREAD_EXPLICIT_SCHED );
api->schedpolicy = the_attr->schedpolicy;
api->schedparam = the_attr->schedparam;
- _Priority_Node_initialize( &api->Sporadic.Low_priority, core_low_prio );
- _Priority_Node_set_inactive( &api->Sporadic.Low_priority );
+ _Priority_Node_set_priority( &api->Sporadic.Low_priority, core_low_prio );
if ( schedpolicy == SCHED_SPORADIC ) {
_POSIX_Threads_Sporadic_timer( &api->Sporadic.Timer );