proc.c
// Give up the CPU for one scheduling round.
Give up the CPU for one scheduling round.
Give up the CPU for one scheduling round .
void
yield(void)
{
  acquire(&ptable.lock);  
  proc->state = RUNNABLE;
  if(policyNumber == 3) {           
	if (proc->ntickets > 1) {
	  proc->ntickets -= 1;
	}		    
  }    
  sched();
  release(&ptable.lock);
}
void yield ( void ) { acquire ( & ptable . lock ) ; proc -> state = RUNNABLE ; if ( policyNumber == 3 ) { if ( proc -> ntickets > 1 ) { proc -> ntickets -= 1 ; } } sched ( ) ; release ( & ptable . lock ) ; }
Give up the CPU for one scheduling round.
Give up the CPU for one scheduling round .
//DOC: yieldlock