diff options
Diffstat (limited to 'cpukit/score/src/schedulersmp.c')
-rw-r--r-- | cpukit/score/src/schedulersmp.c | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/cpukit/score/src/schedulersmp.c b/cpukit/score/src/schedulersmp.c index cc566180b7..3bb2638139 100644 --- a/cpukit/score/src/schedulersmp.c +++ b/cpukit/score/src/schedulersmp.c @@ -21,28 +21,21 @@ #include <rtems/score/schedulersmpimpl.h> -void _Scheduler_Request_ask_for_help( Thread_Control *the_thread ) +void _Scheduler_SMP_Remove_ask_for_help_from_processor( + Thread_Control *thread, + Per_CPU_Control *cpu +) { - ISR_lock_Context scheduler_lock_context; + ISR_lock_Context lock_context; - _Thread_Scheduler_acquire_critical( the_thread, &scheduler_lock_context ); + _Assert( _ISR_lock_Is_owner( &thread->Scheduler.Lock ) ); - if ( _Chain_Is_node_off_chain( &the_thread->Scheduler.Help_node ) ) { - Per_CPU_Control *cpu; - ISR_lock_Context per_cpu_lock_context; + _Per_CPU_Acquire( cpu, &lock_context ); - cpu = _Thread_Get_CPU( the_thread ); - _Per_CPU_Acquire( cpu, &per_cpu_lock_context ); - - _Chain_Append_unprotected( - &cpu->Threads_in_need_for_help, - &the_thread->Scheduler.Help_node - ); - - _Per_CPU_Release( cpu, &per_cpu_lock_context ); - - _Thread_Dispatch_request( _Per_CPU_Get(), cpu ); + if ( thread->Scheduler.ask_for_help_cpu == cpu ) { + _Chain_Extract_unprotected( &thread->Scheduler.Help_node ); + thread->Scheduler.ask_for_help_cpu = NULL; } - _Thread_Scheduler_release_critical( the_thread, &scheduler_lock_context ); + _Per_CPU_Release( cpu, &lock_context ); } |