From 6eba7c857b9e72bc4ed8e55f0c9538c45631484f Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 10 Jun 2013 16:15:46 +0200 Subject: scheduler: Specify thread of yield operation The yielding thread of the yield operation is now specified by a parameter. The tick operation may be performed for each executing thread in a SMP configuration. --- cpukit/score/src/schedulerpriorityyield.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'cpukit/score/src/schedulerpriorityyield.c') diff --git a/cpukit/score/src/schedulerpriorityyield.c b/cpukit/score/src/schedulerpriorityyield.c index c000125daf..4c2b5996c1 100644 --- a/cpukit/score/src/schedulerpriorityyield.c +++ b/cpukit/score/src/schedulerpriorityyield.c @@ -24,28 +24,26 @@ #include #include -void _Scheduler_priority_Yield(void) +void _Scheduler_priority_Yield( Thread_Control *thread ) { Scheduler_priority_Per_thread *sched_info; ISR_Level level; - Thread_Control *executing; Chain_Control *ready; - executing = _Thread_Executing; - sched_info = (Scheduler_priority_Per_thread *) executing->scheduler_info; + sched_info = (Scheduler_priority_Per_thread *) thread->scheduler_info; ready = sched_info->ready_chain; _ISR_Disable( level ); if ( !_Chain_Has_only_one_node( ready ) ) { - _Chain_Extract_unprotected( &executing->Object.Node ); - _Chain_Append_unprotected( ready, &executing->Object.Node ); + _Chain_Extract_unprotected( &thread->Object.Node ); + _Chain_Append_unprotected( ready, &thread->Object.Node ); _ISR_Flash( level ); - if ( _Thread_Is_heir( executing ) ) + if ( _Thread_Is_heir( thread ) ) _Thread_Heir = (Thread_Control *) _Chain_First( ready ); _Thread_Dispatch_necessary = true; } - else if ( !_Thread_Is_heir( executing ) ) + else if ( !_Thread_Is_heir( thread ) ) _Thread_Dispatch_necessary = true; _ISR_Enable( level ); -- cgit v1.2.3