mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-19 18:55:04 +08:00
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.
This commit is contained in:
@@ -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;
|
||||
|
||||
scheduler = _Thread_Scheduler_get_home( the_thread );
|
||||
_Scheduler_Acquire_critical( scheduler, &lock_context );
|
||||
( *scheduler->Operations.unblock )(
|
||||
scheduler,
|
||||
the_thread,
|
||||
_Thread_Scheduler_get_home_node( the_thread )
|
||||
#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, scheduler_node );
|
||||
_Scheduler_Release_critical( scheduler, &lock_context );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user