proc.c
void
yield(void)
{   cprintf("yield\n");
  acquire(&ptable.lock);  //DOC: yieldlock
  proc->state = RUNNABLE;
  //cprintf(proc->p_level);
  if(proc->p_level == high){
        cprintf("high\n");
    insert1(proc);
  }else if(proc->p_level == middle){
      insert2(proc);
   cprintf("moddle\n");
  }else{
      insert3(proc);
       cprintf("low\n");
  }
  insert(proc);
  sched();
  release(&ptable.lock);
}
// 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)
{   cprintf("yield\n");
  acquire(&ptable.lock);  
  proc->state = RUNNABLE;
  if(proc->p_level == high){
        cprintf("high\n");
    insert1(proc);
  }else if(proc->p_level == middle){
      insert2(proc);
   cprintf("moddle\n");
  }else{
      insert3(proc);
       cprintf("low\n");
  }
  insert(proc);
  sched();
  release(&ptable.lock);
}
void yield ( void ) { cprintf ( " \n " ) ; acquire ( & ptable . lock ) ; proc -> state = RUNNABLE ; if ( proc -> p_level == high ) { cprintf ( " \n " ) ; insert1 ( proc ) ; } else if ( proc -> p_level == middle ) { insert2 ( proc ) ; cprintf ( " \n " ) ; } else { insert3 ( proc ) ; cprintf ( " \n " ) ; } insert ( proc ) ; sched ( ) ; release ( & ptable . lock ) ; }
Give up the CPU for one scheduling round.
Give up the CPU for one scheduling round .
//DOC: yieldlock //cprintf(proc->p_level);