summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/threadinitialize.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/threadinitialize.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/threadinitialize.c')
-rw-r--r--cpukit/score/src/threadinitialize.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cpukit/score/src/threadinitialize.c b/cpukit/score/src/threadinitialize.c
index 9f5df257aa..2133d7485b 100644
--- a/cpukit/score/src/threadinitialize.c
+++ b/cpukit/score/src/threadinitialize.c
@@ -201,6 +201,7 @@ bool _Thread_Initialize(
the_thread->Wait.queue = NULL;
the_thread->Wait.operations = &_Thread_queue_Operations_default;
the_thread->resource_count = 0;
+ the_thread->current_priority = priority;
the_thread->real_priority = priority;
the_thread->priority_generation = 0;
the_thread->Start.initial_priority = priority;
@@ -210,7 +211,7 @@ bool _Thread_Initialize(
_Scheduler_Node_initialize( scheduler, the_thread );
scheduler_node_initialized = true;
- _Thread_Set_priority( the_thread, priority );
+ _Scheduler_Update_priority( the_thread, priority );
/*
* Initialize the CPU usage statistics