summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/schedulerpriorityyield.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-02-26 10:33:36 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-03-05 11:36:19 +0100
commitb8a5abf3fafa9df7cc0354c0ada6192c38e78354 (patch)
treea20b108ecbf95fa3e401a8073d7f35603b4bf2e1 /cpukit/score/src/schedulerpriorityyield.c
parentscore: Add and use PRIORITY_PSEUDO_ISR (diff)
downloadrtems-b8a5abf3fafa9df7cc0354c0ada6192c38e78354.tar.bz2
score: Update _Thread_Heir only if necessary
Previously, the _Thread_Heir was updated unconditionally in case a new heir was determined. The _Thread_Dispatch_necessary was only updated in case the executing thread was preemptible or an internal thread was unblocked. Change this to update the _Thread_Heir and _Thread_Dispatch_necessary only in case the currently selected heir thread is preemptible or a dispatch is forced. Move the schedule decision into the change priority operation and use the schedule operation only in rtems_task_mode() in case preemption is enabled or an ASR dispatch is necessary. This is a behaviour change. Previously, the RTEMS_NO_PREEMPT also prevented signal delivery in certain cases (not always). Now, signal delivery is no longer influenced by RTEMS_NO_PREEMPT. Since the currently selected heir thread is used to determine if a new heir is chosen, non-preemptible heir threads currently not executing now prevent a new heir. This may have an application impact, see change test tm04. Document this change in sp04. Update #2273.
Diffstat (limited to 'cpukit/score/src/schedulerpriorityyield.c')
-rw-r--r--cpukit/score/src/schedulerpriorityyield.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/cpukit/score/src/schedulerpriorityyield.c b/cpukit/score/src/schedulerpriorityyield.c
index 2ee2d03057..5dab094f46 100644
--- a/cpukit/score/src/schedulerpriorityyield.c
+++ b/cpukit/score/src/schedulerpriorityyield.c
@@ -29,20 +29,12 @@ Scheduler_Void_or_thread _Scheduler_priority_Yield(
Scheduler_priority_Node *node = _Scheduler_priority_Thread_get_node( the_thread );
Chain_Control *ready_chain = node->Ready_queue.ready_chain;
- (void) scheduler;
-
if ( !_Chain_Has_only_one_node( ready_chain ) ) {
_Chain_Extract_unprotected( &the_thread->Object.Node );
_Chain_Append_unprotected( ready_chain, &the_thread->Object.Node );
-
- if ( _Thread_Is_heir( the_thread ) ) {
- _Thread_Heir = (Thread_Control *) _Chain_First( ready_chain );
- }
-
- _Thread_Dispatch_necessary = true;
- } else if ( !_Thread_Is_heir( the_thread ) ) {
- _Thread_Dispatch_necessary = true;
}
+ _Scheduler_priority_Schedule_body( scheduler, the_thread, true );
+
SCHEDULER_RETURN_VOID_OR_NULL;
}