summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/pthreadgetschedparam.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-11-08 14:37:35 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-11-09 08:12:11 +0100
commit7147dc43b874271a0d4c14bbbc8ea10d1ed57cef (patch)
tree75c26dd9ef681f3558c6f96982e22a22454e2513 /cpukit/posix/src/pthreadgetschedparam.c
parentsptests/spconsole01: New test (diff)
downloadrtems-7147dc43b874271a0d4c14bbbc8ea10d1ed57cef.tar.bz2
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.
Diffstat (limited to 'cpukit/posix/src/pthreadgetschedparam.c')
-rw-r--r--cpukit/posix/src/pthreadgetschedparam.c14
1 files changed, 8 insertions, 6 deletions
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;
}