FreeBSD/sys/kern/kern_synch.c
/*
 * General purpose yield system call.
 */
General purpose yield system call.
General purpose yield system call .
int
sys_yield(struct thread *td, struct yield_args *uap)
{
	thread_lock(td);
	if (PRI_BASE(td->td_pri_class) == PRI_TIMESHARE)
		sched_prio(td, PRI_MAX_TIMESHARE);
	mi_switch(SW_VOL | SWT_RELINQUISH, NULL);
	thread_unlock(td);
	td->td_retval[0] = 0;
	return (0);
}
int sys_yield ( struct thread * td , struct yield_args * uap ) { thread_lock ( td ) ; if ( PRI_BASE ( td -> td_pri_class ) == PRI_TIMESHARE ) sched_prio ( td , PRI_MAX_TIMESHARE ) ; mi_switch ( SW_VOL | SWT_RELINQUISH , NULL ) ; thread_unlock ( td ) ; td -> td_retval [ 0 ] = 0 ; return ( 0 ) ; }
General purpose yield system call.
General purpose yield system call .