FreeBSD/sys/kern/sched_ule.c
/*
 * Schedule a thread to resume execution and record how long it voluntarily
 * slept.  We also update the pctcpu, interactivity, and priority.
 */
Schedule a thread to resume execution and record how long it voluntarily
slept.  We also update the pctcpu, interactivity, and priority.
Schedule a thread to resume execution and record how long it voluntarily slept . We also update the pctcpu interactivity and priority .
void
sched_wakeup(struct thread *td)
{
	struct td_sched *ts;
	int slptick;
	THREAD_LOCK_ASSERT(td, MA_OWNED);
	ts = td_get_sched(td);
	td->td_flags &= ~TDF_CANSWAP;
	slptick = td->td_slptick;
	td->td_slptick = 0;
	if (slptick && slptick != ticks) {
		ts->ts_slptime += (ticks - slptick) << SCHED_TICK_SHIFT;
		sched_interact_update(td);
		sched_pctcpu_update(ts, 0);
	}
	ts->ts_slice = 0;
	sched_add(td, SRQ_BORING);
}
void sched_wakeup ( struct thread * td ) { struct td_sched * ts ; int slptick ; THREAD_LOCK_ASSERT ( td , MA_OWNED ) ; ts = td_get_sched ( td ) ; td -> td_flags &= ~ TDF_CANSWAP ; slptick = td -> td_slptick ; td -> td_slptick = 0 ; if ( slptick && slptick != ticks ) { ts -> ts_slptime += ( ticks - slptick ) << SCHED_TICK_SHIFT ; sched_interact_update ( td ) ; sched_pctcpu_update ( ts , 0 ) ; } ts -> ts_slice = 0 ; sched_add ( td , SRQ_BORING ) ; }
Schedule a thread to resume execution and record how long it voluntarily
 slept.
Schedule a thread to resume execution and record how long it voluntarily slept .
/*
	 * If we slept for more than a tick update our interactivity and
	 * priority.
	 */ /*
	 * Reset the slice value since we slept and advanced the round-robin.
	 */