From 4dc5450eebc1d863ea31f4b5e00fb7a9b67972e8 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 14 Jun 2016 17:21:53 +0200 Subject: posix: Delete POSIX_API_Control::schedpolicy This field was redundant. --- cpukit/posix/include/rtems/posix/threadsup.h | 2 -- cpukit/posix/src/pthread.c | 3 +-- cpukit/posix/src/pthreadcreate.c | 3 +-- cpukit/posix/src/pthreadgetschedparam.c | 2 +- cpukit/posix/src/pthreadsetschedparam.c | 3 +-- cpukit/score/include/rtems/score/thread.h | 1 - 6 files changed, 4 insertions(+), 10 deletions(-) diff --git a/cpukit/posix/include/rtems/posix/threadsup.h b/cpukit/posix/include/rtems/posix/threadsup.h index 60bf0e46da..a9f36ef1ad 100644 --- a/cpukit/posix/include/rtems/posix/threadsup.h +++ b/cpukit/posix/include/rtems/posix/threadsup.h @@ -47,8 +47,6 @@ typedef struct { Thread_Control *thread; /** This is the POSIX threads attribute set. */ pthread_attr_t Attributes; - /** This is the thread's current scheduling policy. */ - int schedpolicy; /** This is the thread's current set of scheduling parameters. */ struct sched_param schedparam; /** diff --git a/cpukit/posix/src/pthread.c b/cpukit/posix/src/pthread.c index 432f70cf1b..33c2830aef 100644 --- a/cpukit/posix/src/pthread.c +++ b/cpukit/posix/src/pthread.c @@ -193,7 +193,6 @@ static bool _POSIX_Threads_Create_extension( /* XXX check all fields are touched */ api->thread = created; _POSIX_Threads_Initialize_attributes( &api->Attributes ); - api->schedpolicy = _POSIX_Threads_Default_attributes.schedpolicy; api->schedparam = _POSIX_Threads_Default_attributes.schedparam; api->schedparam.sched_priority = _POSIX_Priority_From_core( created->current_priority ); @@ -232,7 +231,7 @@ static void _POSIX_Threads_Terminate_extension( Thread_Control *executing ) _Thread_State_acquire( executing, &lock_context ); - if ( api->schedpolicy == SCHED_SPORADIC ) { + if ( api->Attributes.schedpolicy == SCHED_SPORADIC ) { _Watchdog_Per_CPU_remove_relative( &api->Sporadic_timer ); } diff --git a/cpukit/posix/src/pthreadcreate.c b/cpukit/posix/src/pthreadcreate.c index a120fdda8d..019ccc86a8 100644 --- a/cpukit/posix/src/pthreadcreate.c +++ b/cpukit/posix/src/pthreadcreate.c @@ -110,7 +110,7 @@ int pthread_create( switch ( the_attr->inheritsched ) { case PTHREAD_INHERIT_SCHED: api = executing->API_Extensions[ THREAD_API_POSIX ]; - schedpolicy = api->schedpolicy; + schedpolicy = api->Attributes.schedpolicy; schedparam = api->schedparam; break; @@ -226,7 +226,6 @@ int pthread_create( api = the_thread->API_Extensions[ THREAD_API_POSIX ]; _POSIX_Threads_Copy_attributes( &api->Attributes, the_attr ); - api->schedpolicy = schedpolicy; api->schedparam = schedparam; if ( schedpolicy == SCHED_SPORADIC ) { diff --git a/cpukit/posix/src/pthreadgetschedparam.c b/cpukit/posix/src/pthreadgetschedparam.c index 9b6969ce8e..d03a8a8113 100644 --- a/cpukit/posix/src/pthreadgetschedparam.c +++ b/cpukit/posix/src/pthreadgetschedparam.c @@ -51,7 +51,7 @@ int pthread_getschedparam( _Thread_State_acquire_critical( the_thread, &lock_context ); api = the_thread->API_Extensions[ THREAD_API_POSIX ]; - *policy = api->schedpolicy; + *policy = api->Attributes.schedpolicy; *param = api->schedparam; param->sched_priority = _POSIX_Priority_From_core( the_thread->real_priority diff --git a/cpukit/posix/src/pthreadsetschedparam.c b/cpukit/posix/src/pthreadsetschedparam.c index 55019dd690..30ddd0347c 100644 --- a/cpukit/posix/src/pthreadsetschedparam.c +++ b/cpukit/posix/src/pthreadsetschedparam.c @@ -80,11 +80,10 @@ int pthread_setschedparam( api = the_thread->API_Extensions[ THREAD_API_POSIX ]; - if ( api->schedpolicy == SCHED_SPORADIC ) { + if ( api->Attributes.schedpolicy == SCHED_SPORADIC ) { _Watchdog_Per_CPU_remove_relative( &api->Sporadic_timer ); } - api->schedpolicy = policy; api->schedparam = *param; api->Attributes.schedpolicy = policy; api->Attributes.schedparam = *param; diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h index 7491e8fcdf..d98658cb9d 100644 --- a/cpukit/score/include/rtems/score/thread.h +++ b/cpukit/score/include/rtems/score/thread.h @@ -712,7 +712,6 @@ struct _Thread_Control { * * - POSIX_API_Control::Attributes, * - POSIX_API_Control::schedparam, - * - POSIX_API_Control::schedpolicy, * - RTEMS_API_Control::Signal, * - Thread_Control::budget_algorithm, * - Thread_Control::budget_callout, -- cgit v1.2.3