FreeBSD/sys/kern/sched_ule.c
/*
 * Standard entry for setting the priority to an absolute value.
 */
Standard entry for setting the priority to an absolute value.
Standard entry for setting the priority to an absolute value .
void
sched_prio(struct thread *td, u_char prio)
{
	u_char oldprio;
	td->td_base_pri = prio;
	if (td->td_flags & TDF_BORROWING && td->td_priority < prio)
		return;
	oldprio = td->td_priority;
	sched_thread_priority(td, prio);
	if (TD_ON_LOCK(td) && oldprio != prio)
		turnstile_adjust(td, oldprio);
}
void sched_prio ( struct thread * td , u_char prio ) { u_char oldprio ; td -> td_base_pri = prio ; if ( td -> td_flags & TDF_BORROWING && td -> td_priority < prio ) return ; oldprio = td -> td_priority ; sched_thread_priority ( td , prio ) ; if ( TD_ON_LOCK ( td ) && oldprio != prio ) turnstile_adjust ( td , oldprio ) ; }
Standard entry for setting the priority to an absolute value.
Standard entry for setting the priority to an absolute value .
/* First, update the base priority. */ /*
	 * If the thread is borrowing another thread's priority, don't
	 * ever lower the priority.
	 */ /* Change the real priority. */ /*
	 * If the thread is on a turnstile, then let the turnstile update
	 * its state.
	 */