summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/threadinitialize.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-03-17 16:24:44 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-03-20 08:49:33 +0100
commit6a941e3a9986d3cfb3e4ed0139e983b0455cc73b (patch)
tree9ad4114b0eea22a82ddc51274a1b6e550ff3f4dd /cpukit/score/src/threadinitialize.c
parentscore: Delete unused _Timestamp_Is_valid() (diff)
downloadrtems-6a941e3a9986d3cfb3e4ed0139e983b0455cc73b.tar.bz2
score: Fix _Thread_Change_priority()
Atomically update the current priority of a thread and the wait queue. Serialize the scheduler update in a separate critical section with a generation number. New test sptests/spintrcritical23. Close #2310.
Diffstat (limited to 'cpukit/score/src/threadinitialize.c')
-rw-r--r--cpukit/score/src/threadinitialize.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/cpukit/score/src/threadinitialize.c b/cpukit/score/src/threadinitialize.c
index 934fea9085..993d95fdb8 100644
--- a/cpukit/score/src/threadinitialize.c
+++ b/cpukit/score/src/threadinitialize.c
@@ -198,6 +198,7 @@ bool _Thread_Initialize(
the_thread->Wait.queue = NULL;
the_thread->resource_count = 0;
the_thread->real_priority = priority;
+ the_thread->priority_generation = 0;
the_thread->Start.initial_priority = priority;
_Thread_Wait_flags_set( the_thread, THREAD_WAIT_FLAGS_INITIAL );