Esempio n. 1
0
void _Scheduler_simple_Update_priority(
  const Scheduler_Control *scheduler,
  Thread_Control          *the_thread,
  Scheduler_Node          *node
)
{
  Scheduler_simple_Context *context;
  bool                      prepend_it;

  if ( !_Thread_Is_ready( the_thread ) ) {
    /* Nothing to do */
    return;
  }

  context = _Scheduler_simple_Get_context( scheduler );
  _Scheduler_Node_get_priority( node, &prepend_it );

  _Scheduler_simple_Extract( scheduler, the_thread, node );

  if ( prepend_it ) {
    _Scheduler_simple_Insert_priority_lifo( &context->Ready, the_thread );
  } else {
    _Scheduler_simple_Insert_priority_fifo( &context->Ready, the_thread );
  }

  _Scheduler_simple_Schedule_body( scheduler, the_thread, false );
}
Esempio n. 2
0
static void _Scheduler_simple_smp_Move_from_scheduled_to_ready(
  Chain_Control *ready_chain,
  Thread_Control *scheduled_to_ready
)
{
  _Chain_Extract_unprotected( &scheduled_to_ready->Object.Node );
  _Scheduler_simple_Insert_priority_lifo( ready_chain, scheduled_to_ready );
}
Esempio n. 3
0
static void _Scheduler_simple_SMP_Move_from_scheduled_to_ready(
  Scheduler_Context *context,
  Thread_Control *scheduled_to_ready
)
{
  Scheduler_simple_SMP_Context *self =
    _Scheduler_simple_SMP_Get_self( context );

  _Chain_Extract_unprotected( &scheduled_to_ready->Object.Node );
  _Scheduler_simple_Insert_priority_lifo(
    &self->Ready,
    scheduled_to_ready
  );
}