FreeBSD/sys/kern/sched_ule.c
/*
 * Set owepreempt if necessary.  Preemption never happens directly in ULE,
 * we always request it once we exit a critical section.
 */
Set owepreempt if necessary.  Preemption never happens directly in ULE,
we always request it once we exit a critical section.
Set owepreempt if necessary . Preemption never happens directly in ULE we always request it once we exit a critical section .
static inline void
sched_setpreempt(struct thread *td)
{
	struct thread *ctd;
	int cpri;
	int pri;
	THREAD_LOCK_ASSERT(curthread, MA_OWNED);
	ctd = curthread;
	pri = td->td_priority;
	cpri = ctd->td_priority;
	if (pri < cpri)
		ctd->td_flags |= TDF_NEEDRESCHED;
	if (panicstr != NULL || pri >= cpri || cold || TD_IS_INHIBITED(ctd))
		return;
	if (!sched_shouldpreempt(pri, cpri, 0))
		return;
	ctd->td_owepreempt = 1;
}
static inline void sched_setpreempt ( struct thread * td ) { struct thread * ctd ; int cpri ; int pri ; THREAD_LOCK_ASSERT ( curthread , MA_OWNED ) ; ctd = curthread ; pri = td -> td_priority ; cpri = ctd -> td_priority ; if ( pri < cpri ) ctd -> td_flags |= TDF_NEEDRESCHED ; if ( panicstr != NULL || pri >= cpri || cold || TD_IS_INHIBITED ( ctd ) ) return ; if ( ! sched_shouldpreempt ( pri , cpri , 0 ) ) return ; ctd -> td_owepreempt = 1 ; }
Set owepreempt if necessary.
Set owepreempt if necessary .