From 7147dc43b874271a0d4c14bbbc8ea10d1ed57cef Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 8 Nov 2017 14:37:35 +0100 Subject: posix: Remove POSIX_API_Control::schedpolicy Use the thread CPU budget algorithm to determine the scheduler policy. This fixes also pthread_getschedparam() for Classic tasks. Update #2514. --- cpukit/posix/src/pthreadgetschedparam.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'cpukit/posix/src/pthreadgetschedparam.c') diff --git a/cpukit/posix/src/pthreadgetschedparam.c b/cpukit/posix/src/pthreadgetschedparam.c index a5494b5922..25c6195967 100644 --- a/cpukit/posix/src/pthreadgetschedparam.c +++ b/cpukit/posix/src/pthreadgetschedparam.c @@ -36,11 +36,12 @@ int pthread_getschedparam( struct sched_param *param ) { - Thread_Control *the_thread; - Thread_queue_Context queue_context; - POSIX_API_Control *api; - const Scheduler_Control *scheduler; - Priority_Control priority; + Thread_Control *the_thread; + Thread_queue_Context queue_context; + const POSIX_API_Control *api; + Thread_CPU_budget_algorithms budget_algorithm; + const Scheduler_Control *scheduler; + Priority_Control priority; if ( policy == NULL || param == NULL ) { return EINVAL; @@ -57,13 +58,14 @@ int pthread_getschedparam( _Thread_Wait_acquire_critical( the_thread, &queue_context ); - *policy = api->schedpolicy; scheduler = _Thread_Scheduler_get_home( the_thread ); _POSIX_Threads_Get_sched_param_sporadic( the_thread, api, scheduler, param ); priority = the_thread->Real_priority.priority; + budget_algorithm = the_thread->budget_algorithm; _Thread_Wait_release( the_thread, &queue_context ); param->sched_priority = _POSIX_Priority_From_core( scheduler, priority ); + *policy = _POSIX_Thread_Translate_to_sched_policy( budget_algorithm ); return 0; } -- cgit v1.2.3