summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/pthreadsetschedparam.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-05-05 13:05:54 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-05-19 12:00:47 +0200
commit900d337f960cb7cc53f5c93c29a503e5ced2c31f (patch)
tree1d1f49724e5cfcef1974d5dc4251486b0fddd2ef /cpukit/posix/src/pthreadsetschedparam.c
parentscore: Fine grained locking for mutexes (diff)
downloadrtems-900d337f960cb7cc53f5c93c29a503e5ced2c31f.tar.bz2
score: Rework _Thread_Change_priority()
Move the writes to Thread_Control::current_priority and Thread_Control::real_priority into _Thread_Change_priority() under the protection of the thread lock. Add a filter function to _Thread_Change_priority() to enable specialized variants. Avoid race conditions during a thread priority restore with the new Thread_Control::priority_restore_hint for an important average case optimizations used by priority inheritance mutexes. Update #2273.
Diffstat (limited to 'cpukit/posix/src/pthreadsetschedparam.c')
-rw-r--r--cpukit/posix/src/pthreadsetschedparam.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/cpukit/posix/src/pthreadsetschedparam.c b/cpukit/posix/src/pthreadsetschedparam.c
index dcb70bdec8..067e6ba509 100644
--- a/cpukit/posix/src/pthreadsetschedparam.c
+++ b/cpukit/posix/src/pthreadsetschedparam.c
@@ -44,6 +44,7 @@ int pthread_setschedparam(
Thread_CPU_budget_algorithm_callout budget_callout;
Objects_Locations location;
int rc;
+ Priority_Control unused;
/*
* Check all the parameters
@@ -87,13 +88,11 @@ int pthread_setschedparam(
the_thread->cpu_time_budget =
rtems_configuration_get_ticks_per_timeslice();
- the_thread->real_priority =
- _POSIX_Priority_To_core( api->schedparam.sched_priority );
-
- _Thread_Change_priority(
- the_thread,
- the_thread->real_priority,
- true
+ _Thread_Set_priority(
+ the_thread,
+ _POSIX_Priority_To_core( api->schedparam.sched_priority ),
+ &unused,
+ true
);
break;