xv6-l/proc.c
void
yield(void)
{
  struct proc *p = myproc();
  acquire(&ptable.lock);  //DOC: yieldlock

  p->state = RUNNABLE;

  //brand new
  if(p->priority>0)
    p->priority--;
  qpush(p);

  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)
{
  struct proc *p = myproc();
  acquire(&ptable.lock);  
  p->state = RUNNABLE;
  if(p->priority>0)
    p->priority--;
  qpush(p);
  sched();
  release(&ptable.lock);
}
void yield ( void ) { struct proc * p = myproc ( ) ; acquire ( & ptable . lock ) ; p -> state = RUNNABLE ; if ( p -> priority > 0 ) p -> priority -- ; qpush ( p ) ; sched ( ) ; release ( & ptable . lock ) ; }
Give up the CPU for one scheduling round.
Give up the CPU for one scheduling round .
//DOC: yieldlock //brand new