FreeBSD/sys/kern/kern_kthread.c
/*
 * Advise a kernel process to suspend (or resume) in its main loop.
 * Participation is voluntary.
 */
Advise a kernel process to suspend (or resume) in its main loop.
Participation is voluntary.
Advise a kernel process to suspend ( or resume ) in its main loop . Participation is voluntary .
int
kproc_suspend(struct proc *p, int timo)
{
	PROC_LOCK(p);
	if ((p->p_flag & P_KPROC) == 0) {
		PROC_UNLOCK(p);
		return (EINVAL);
	}
	SIGADDSET(p->p_siglist, SIGSTOP);
	wakeup(p);
	return msleep(&p->p_siglist, &p->p_mtx, PPAUSE | PDROP, "suspkp", timo);
}
int kproc_suspend ( struct proc * p , int timo ) { PROC_LOCK ( p ) ; if ( ( p -> p_flag & P_KPROC ) == 0 ) { PROC_UNLOCK ( p ) ; return ( EINVAL ) ; } SIGADDSET ( p -> p_siglist , SIGSTOP ) ; wakeup ( p ) ; return msleep ( & p -> p_siglist , & p -> p_mtx , PPAUSE | PDROP , " " , timo ) ; }
Advise a kernel process to suspend (or resume) in its main loop.
Advise a kernel process to suspend ( or resume ) in its main loop .
/*
	 * Make sure this is indeed a system process and we can safely
	 * use the p_siglist field.
	 */