diff --git a/cpukit/posix/src/pthreadcreate.c b/cpukit/posix/src/pthreadcreate.c index 54b6a71040..411882d532 100644 --- a/cpukit/posix/src/pthreadcreate.c +++ b/cpukit/posix/src/pthreadcreate.c @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -103,7 +104,6 @@ int pthread_create( #endif executing = _Thread_Get_executing(); - scheduler = _Scheduler_Get_own( executing ); /* * P1003.1c/Draft 10, p. 121. @@ -115,9 +115,12 @@ int pthread_create( */ switch ( the_attr->inheritsched ) { case PTHREAD_INHERIT_SCHED: - api = executing->API_Extensions[ THREAD_API_POSIX ]; - schedpolicy = api->Attributes.schedpolicy; - schedparam = api->Attributes.schedparam; + error = pthread_getschedparam( + pthread_self(), + &schedpolicy, + &schedparam + ); + _Assert( error == 0 ); break; case PTHREAD_EXPLICIT_SCHED: