FreeBSD/sys/kern/subr_sleepqueue.c
/*
 * Sets a timeout that will remove the current thread from the specified
 * sleep queue after timo ticks if the thread has not already been awakened.
 */
Sets a timeout that will remove the current thread from the specified
sleep queue after timo ticks if the thread has not already been awakened.
Sets a timeout that will remove the current thread from the specified sleep queue after timo ticks if the thread has not already been awakened .
void
sleepq_set_timeout_sbt(void *wchan, sbintime_t sbt, sbintime_t pr,
    int flags)
{
	struct sleepqueue_chain *sc;
	struct thread *td;
	td = curthread;
	sc = SC_LOOKUP(wchan);
	mtx_assert(&sc->sc_lock, MA_OWNED);
	MPASS(TD_ON_SLEEPQ(td));
	MPASS(td->td_sleepqueue == NULL);
	MPASS(wchan != NULL);
	if (cold)
		panic("timed sleep before timers are working");
	callout_reset_sbt_on(&td->td_slpcallout, sbt, pr,
	    sleepq_timeout, td, PCPU_GET(cpuid), flags | C_DIRECT_EXEC);
}
void sleepq_set_timeout_sbt ( void * wchan , sbintime_t sbt , sbintime_t pr , int flags ) { struct sleepqueue_chain * sc ; struct thread * td ; td = curthread ; sc = SC_LOOKUP ( wchan ) ; mtx_assert ( & sc -> sc_lock , MA_OWNED ) ; MPASS ( TD_ON_SLEEPQ ( td ) ) ; MPASS ( td -> td_sleepqueue == NULL ) ; MPASS ( wchan != NULL ) ; if ( cold ) panic ( " " ) ; callout_reset_sbt_on ( & td -> td_slpcallout , sbt , pr , sleepq_timeout , td , PCPU_GET ( cpuid ) , flags | C_DIRECT_EXEC ) ; }
Sets a timeout that will remove the current thread from the specified
 sleep queue after timo ticks if the thread has not already been awakened.
Sets a timeout that will remove the current thread from the specified sleep queue after timo ticks if the thread has not already been awakened .