void _Scheduler_Thread_change_resource_root( Thread_Control *top, Thread_Control *root ) { Scheduler_Set_root_context ctx = { root, NULL }; Thread_Control *offers_help = top; Scheduler_Node *offers_help_node; Thread_Control *offers_help_too; offers_help_node = _Scheduler_Thread_get_node( offers_help ); offers_help_too = _Scheduler_Node_get_owner( offers_help_node ); if ( offers_help != offers_help_too ) { _Scheduler_Set_root_visitor( &offers_help_too->Resource_node, &ctx ); _Assert( ctx.needs_help == offers_help ); ctx.needs_help = NULL; } _Scheduler_Set_root_visitor( &top->Resource_node, &ctx ); _Resource_Iterate( &top->Resource_node, _Scheduler_Set_root_visitor, &ctx ); if ( ctx.needs_help != NULL ) { _Scheduler_Ask_for_help( ctx.needs_help ); } }
/* * This method returns the scheduler node for the specified thread * as a scheduler specific type. */ static Scheduler_priority_affinity_SMP_Node * _Scheduler_priority_affinity_SMP_Thread_get_node( Thread_Control *thread ) { return (Scheduler_priority_affinity_SMP_Node *) _Scheduler_Thread_get_node( thread ); }
void _Scheduler_priority_SMP_Update_priority( const Scheduler_Control *scheduler, Thread_Control *thread, Priority_Control new_priority ) { Scheduler_Context *context = _Scheduler_Get_context( scheduler ); Scheduler_Node *node = _Scheduler_Thread_get_node( thread ); _Scheduler_priority_SMP_Do_update( context, node, new_priority ); }