FreeBSD/sys/kern/subr_sleepqueue.c
/*
 * Block the current thread until it is awakened from its sleep queue
 * or it times out while waiting.
 */
Block the current thread until it is awakened from its sleep queue
or it times out while waiting.
Block the current thread until it is awakened from its sleep queue or it times out while waiting .
int
sleepq_timedwait(void *wchan, int pri)
{
	struct thread *td;
	int rval;
	td = curthread;
	MPASS(!(td->td_flags & TDF_SINTR));
	thread_lock(td);
	sleepq_switch(wchan, pri);
	rval = sleepq_check_timeout();
	thread_unlock(td);
	return (rval);
}
int sleepq_timedwait ( void * wchan , int pri ) { struct thread * td ; int rval ; td = curthread ; MPASS ( ! ( td -> td_flags & TDF_SINTR ) ) ; thread_lock ( td ) ; sleepq_switch ( wchan , pri ) ; rval = sleepq_check_timeout ( ) ; thread_unlock ( td ) ; return ( rval ) ; }
Block the current thread until it is awakened from its sleep queue
 or it times out while waiting.
Block the current thread until it is awakened from its sleep queue or it times out while waiting .