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