diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-09-07 11:27:45 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-09-10 10:38:45 +0200 |
commit | d8bc0730f791e85d46506d689ff3e7d2c6a199a7 (patch) | |
tree | fac73b558f5915203c3eb57effb6485607143e25 /cpukit/include/rtems/score | |
parent | score: Add flexible per-CPU data (diff) | |
download | rtems-d8bc0730f791e85d46506d689ff3e7d2c6a199a7.tar.bz2 |
score: Modify _Scheduler_Unblock()
In SMP configurations, obtain the scheduler node for the block and
unblock operations through the same way via
Thread_Control::Scheduler::Scheduler_node. This symmetry is important
in a follow up patch which introduces thread pinning.
Update #3508.
Diffstat (limited to 'cpukit/include/rtems/score')
-rw-r--r-- | cpukit/include/rtems/score/schedulerimpl.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/cpukit/include/rtems/score/schedulerimpl.h b/cpukit/include/rtems/score/schedulerimpl.h index 10c12242a9..2fe30b3d6b 100644 --- a/cpukit/include/rtems/score/schedulerimpl.h +++ b/cpukit/include/rtems/score/schedulerimpl.h @@ -299,16 +299,22 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Block( Thread_Control *the_thread ) */ RTEMS_INLINE_ROUTINE void _Scheduler_Unblock( Thread_Control *the_thread ) { + Scheduler_Node *scheduler_node; const Scheduler_Control *scheduler; ISR_lock_Context lock_context; +#if defined(RTEMS_SMP) + scheduler_node = SCHEDULER_NODE_OF_THREAD_SCHEDULER_NODE( + _Chain_First( &the_thread->Scheduler.Scheduler_nodes ) + ); + scheduler = _Scheduler_Node_get_scheduler( scheduler_node ); +#else + scheduler_node = _Thread_Scheduler_get_home_node( the_thread ); scheduler = _Thread_Scheduler_get_home( the_thread ); +#endif + _Scheduler_Acquire_critical( scheduler, &lock_context ); - ( *scheduler->Operations.unblock )( - scheduler, - the_thread, - _Thread_Scheduler_get_home_node( the_thread ) - ); + ( *scheduler->Operations.unblock )( scheduler, the_thread, scheduler_node ); _Scheduler_Release_critical( scheduler, &lock_context ); } |