summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-11-16 15:04:21 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-11-16 15:25:45 +0100
commitec771f253182569dd5e046f39785a22c6c6f8e44 (patch)
treec69e132b046d562c4d183dbf3299848bb92b27ae /cpukit/score/src
parentscore: Fix _Thread_queue_Flush_critical() (diff)
downloadrtems-ec771f253182569dd5e046f39785a22c6c6f8e44.tar.bz2
score: Fix priority ceiling updates
We must not clear the priority updates in _Thread_queue_Extract_locked() since this function is used by the priority ceiling surrender operations after the ceiling priority handover from the previous owner to the new owner. This is especially important in SMP configurations. Move the _Thread_queue_Context_clear_priority_updates() invocation to the callers. Close #3237.
Diffstat (limited to 'cpukit/score/src')
-rw-r--r--cpukit/score/src/threadqenqueue.c2
-rw-r--r--cpukit/score/src/threadqflush.c7
2 files changed, 8 insertions, 1 deletions
diff --git a/cpukit/score/src/threadqenqueue.c b/cpukit/score/src/threadqenqueue.c
index 62d3671222..f62ec29b02 100644
--- a/cpukit/score/src/threadqenqueue.c
+++ b/cpukit/score/src/threadqenqueue.c
@@ -568,7 +568,6 @@ bool _Thread_queue_Extract_locked(
Thread_queue_Context *queue_context
)
{
- _Thread_queue_Context_clear_priority_updates( queue_context );
#if defined(RTEMS_MULTIPROCESSING)
_Thread_queue_MP_set_callout( the_thread, queue_context );
#endif
@@ -627,6 +626,7 @@ void _Thread_queue_Extract( Thread_Control *the_thread )
Thread_queue_Queue *queue;
_Thread_queue_Context_initialize( &queue_context );
+ _Thread_queue_Context_clear_priority_updates( &queue_context );
_Thread_Wait_acquire( the_thread, &queue_context );
queue = the_thread->Wait.queue;
diff --git a/cpukit/score/src/threadqflush.c b/cpukit/score/src/threadqflush.c
index ef4d6b1f09..4310e06edf 100644
--- a/cpukit/score/src/threadqflush.c
+++ b/cpukit/score/src/threadqflush.c
@@ -92,6 +92,13 @@ size_t _Thread_queue_Flush_critical(
break;
}
+ /*
+ * We do not have enough space in the queue context to collect all priority
+ * updates, so clear it each time. We unconditionally do the priority
+ * update for the owner later if it exists.
+ */
+ _Thread_queue_Context_clear_priority_updates( queue_context );
+
do_unblock = _Thread_queue_Extract_locked(
queue,
operations,