Exemple #1
0
/*
 * task_tick_other_rr is invoked on each scheduler timer tick.
 */
static void task_tick_other_rr(struct rq *rq, struct task_struct *p, int queued)
{
	// first update the task's runtime statistics
	update_curr_other_rr(rq);

	if(other_rr_time_slice != 0)
	{
		p->task_time_slice--;

		if(p->task_time_slice == 0)
		{
			p->task_time_slice = other_rr_time_slice;
			set_tsk_need_resched(p);
			requeue_task_other_rr(rq, rq->curr);
		}
	}
}
/*
 * current process is relinquishing control of the CPU
 */
static void
yield_task_other_rr(struct rq *rq)
{
	requeue_task_other_rr(rq,&rq->other_rr);
}