summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/schedulercbs.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/score/src/schedulercbs.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/score/src/schedulercbs.c')
-rw-r--r--cpukit/score/src/schedulercbs.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/cpukit/score/src/schedulercbs.c b/cpukit/score/src/schedulercbs.c
index 44221cdbdf..98ec0eb29e 100644
--- a/cpukit/score/src/schedulercbs.c
+++ b/cpukit/score/src/schedulercbs.c
@@ -27,15 +27,13 @@ void _Scheduler_CBS_Budget_callout(
)
{
Priority_Control new_priority;
+ Priority_Control unused;
Scheduler_CBS_Node *node;
Scheduler_CBS_Server_id server_id;
/* Put violating task to background until the end of period. */
new_priority = the_thread->Start.initial_priority;
- if ( the_thread->real_priority != new_priority )
- the_thread->real_priority = new_priority;
- if ( the_thread->current_priority != new_priority )
- _Thread_Change_priority(the_thread, new_priority, true);
+ _Thread_Set_priority( the_thread, new_priority, &unused, true );
/* Invoke callback function if any. */
node = _Scheduler_CBS_Thread_get_node( the_thread );