FreeBSD/sys/kern/kern_kthread.c
/*
 * Resume a thread previously put asleep with kthread_suspend().
 */
Resume a thread previously put asleep with kthread_suspend().
Resume a thread previously put asleep with kthread_suspend () .
int
kthread_resume(struct thread *td)
{
	struct proc *p;
	p = td->td_proc;
	if ((td->td_pflags & TDP_KTHREAD) == 0)
		return (EINVAL);
	PROC_LOCK(p);
	thread_lock(td);
	td->td_flags &= ~TDF_KTH_SUSP;
	thread_unlock(td);
	wakeup(&td->td_flags);
	PROC_UNLOCK(p);
	return (0);
}
int kthread_resume ( struct thread * td ) { struct proc * p ; p = td -> td_proc ; if ( ( td -> td_pflags & TDP_KTHREAD ) == 0 ) return ( EINVAL ) ; PROC_LOCK ( p ) ; thread_lock ( td ) ; td -> td_flags &= ~ TDF_KTH_SUSP ; thread_unlock ( td ) ; wakeup ( & td -> td_flags ) ; PROC_UNLOCK ( p ) ; return ( 0 ) ; }
Resume a thread previously put asleep with kthread_suspend().
Resume a thread previously put asleep with kthread_suspend () .
/*
	 * td_pflags should not be read by any thread other than
	 * curthread, but as long as this flag is invariant during the
	 * thread's lifetime, it is OK to check its state.
	 */