summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/pthreadgetschedparam.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-06-14 15:57:54 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-06-22 14:00:28 +0200
commit5a32c486f9b7bd8687af253931b47d7abb091bc3 (patch)
tree31f97524b91bb123eb316b00e8056e5d62cf5200 /cpukit/posix/src/pthreadgetschedparam.c
parentposix: Rework sporadic server scheduling policy (diff)
downloadrtems-5a32c486f9b7bd8687af253931b47d7abb091bc3.tar.bz2
posix: Make POSIX API aware of scheduler instances
Diffstat (limited to 'cpukit/posix/src/pthreadgetschedparam.c')
-rw-r--r--cpukit/posix/src/pthreadgetschedparam.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/cpukit/posix/src/pthreadgetschedparam.c b/cpukit/posix/src/pthreadgetschedparam.c
index 6751c647d7..a0a4c6e15b 100644
--- a/cpukit/posix/src/pthreadgetschedparam.c
+++ b/cpukit/posix/src/pthreadgetschedparam.c
@@ -26,6 +26,7 @@
#include <rtems/posix/pthreadimpl.h>
#include <rtems/posix/priorityimpl.h>
+#include <rtems/score/schedulerimpl.h>
#include <rtems/score/threadimpl.h>
int pthread_getschedparam(
@@ -34,9 +35,11 @@ int pthread_getschedparam(
struct sched_param *param
)
{
- Thread_Control *the_thread;
- ISR_lock_Context lock_context;
- POSIX_API_Control *api;
+ Thread_Control *the_thread;
+ ISR_lock_Context lock_context;
+ POSIX_API_Control *api;
+ const Scheduler_Control *scheduler;
+ Priority_Control priority;
if ( policy == NULL || param == NULL ) {
return EINVAL;
@@ -54,10 +57,12 @@ int pthread_getschedparam(
*policy = api->Attributes.schedpolicy;
*param = api->Attributes.schedparam;
- param->sched_priority = _POSIX_Priority_From_core(
- the_thread->real_priority
- );
+
+ scheduler = _Scheduler_Get_own( the_thread );
+ priority = the_thread->real_priority;
_Thread_Lock_release_default( the_thread, &lock_context );
+
+ param->sched_priority = _POSIX_Priority_From_core( scheduler, priority );
return 0;
}