summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/score/coresemimpl.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-03-25 09:11:26 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-09-01 20:24:57 +0200
commit9c0591f12d450401746bc0bf7cd7a0e0b14a5f3b (patch)
tree02640af241b723d162024131701a0b518c961bf8 /cpukit/include/rtems/score/coresemimpl.h
parentscore: Document Futex Handler (diff)
downloadrtems-9c0591f12d450401746bc0bf7cd7a0e0b14a5f3b.tar.bz2
score: Fix priority discipline handling
The priority queues in clustered scheduling configurations use a per scheduler priority queue rotation to ensure FIFO fairness across schedulers. This mechanism is implemented in the thread queue surrender operation. Unfortunately some semaphore and message queue directives used wrongly the thread queue extract operation. Fix this through the use of _Thread_queue_Surrender(). Update #4358.
Diffstat (limited to 'cpukit/include/rtems/score/coresemimpl.h')
-rw-r--r--cpukit/include/rtems/score/coresemimpl.h20
1 files changed, 9 insertions, 11 deletions
diff --git a/cpukit/include/rtems/score/coresemimpl.h b/cpukit/include/rtems/score/coresemimpl.h
index ba4825bce9..40b58cbda7 100644
--- a/cpukit/include/rtems/score/coresemimpl.h
+++ b/cpukit/include/rtems/score/coresemimpl.h
@@ -133,23 +133,21 @@ RTEMS_INLINE_ROUTINE Status_Control _CORE_semaphore_Surrender(
Thread_queue_Context *queue_context
)
{
- Thread_Control *the_thread;
- Status_Control status;
+ Status_Control status;
+ Thread_queue_Heads *heads;
status = STATUS_SUCCESSFUL;
_CORE_semaphore_Acquire_critical( the_semaphore, queue_context );
- the_thread = _Thread_queue_First_locked(
- &the_semaphore->Wait_queue,
- operations
- );
- if ( the_thread != NULL ) {
- _Thread_queue_Extract_critical(
+ heads = the_semaphore->Wait_queue.Queue.heads;
+
+ if ( heads != NULL ) {
+ _Thread_queue_Surrender_no_priority(
&the_semaphore->Wait_queue.Queue,
- operations,
- the_thread,
- queue_context
+ heads,
+ queue_context,
+ operations
);
} else {
if ( the_semaphore->count < maximum_count )