FreeBSD/sys/kern/sched_ule.c
/*
 * Attempt to steal a thread in priority order from a thread queue.
 */
Attempt to steal a thread in priority order from a thread queue.
Attempt to steal a thread in priority order from a thread queue .
static struct thread *
tdq_steal(struct tdq *tdq, int cpu)
{
	struct thread *td;
	TDQ_LOCK_ASSERT(tdq, MA_OWNED);
	if ((td = runq_steal(&tdq->tdq_realtime, cpu)) != NULL)
		return (td);
	if ((td = runq_steal_from(&tdq->tdq_timeshare,
	    cpu, tdq->tdq_ridx)) != NULL)
		return (td);
	return (runq_steal(&tdq->tdq_idle, cpu));
}
static struct thread * tdq_steal ( struct tdq * tdq , int cpu ) { struct thread * td ; TDQ_LOCK_ASSERT ( tdq , MA_OWNED ) ; if ( ( td = runq_steal ( & tdq -> tdq_realtime , cpu ) ) != NULL ) return ( td ) ; if ( ( td = runq_steal_from ( & tdq -> tdq_timeshare , cpu , tdq -> tdq_ridx ) ) != NULL ) return ( td ) ; return ( runq_steal ( & tdq -> tdq_idle , cpu ) ) ; }
Attempt to steal a thread in priority order from a thread queue.
Attempt to steal a thread in priority order from a thread queue .