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;
  AddReadyList(proc);
  sched();
  release(&ptable.lock);
}
void yield ( void ) { acquire ( & ptable . lock ) ; proc -> state = RUNNABLE ; AddReadyList ( proc ) ; sched ( ) ; release ( & ptable . lock ) ; }
Give up the CPU for one scheduling round.
Give up the CPU for one scheduling round .
//DOC: yieldlock