proc.c
static void
wakeup1(void *chan)
{
  struct proc *p;

  for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
    if(p->state == SLEEPING && p->chan == chan){
        p->state = RUNNABLE;
        if(p->p_level == high){
            insert1(p);
        }else if(p->p_level == middle){
            insert2(p);
        }else{
            insert3(p);
        }
        insert(p);
    }
}
//PAGEBREAK!
// Wake up all processes sleeping on chan.
// The ptable lock must be held.
PAGEBREAK.
Wake up all processes sleeping on chan.
The ptable lock must be held.
PAGEBREAK . Wake up all processes sleeping on chan . The ptable lock must be held .
static void
wakeup1(void *chan)
{
  struct proc *p;
  for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
    if(p->state == SLEEPING && p->chan == chan){
        p->state = RUNNABLE;
        if(p->p_level == high){
            insert1(p);
        }else if(p->p_level == middle){
            insert2(p);
        }else{
            insert3(p);
        }
        insert(p);
    }
}
static void wakeup1 ( void * chan ) { struct proc * p ; for ( p = ptable . proc ; p < & ptable . proc [ NPROC ] ; p ++ ) if ( p -> state == SLEEPING && p -> chan == chan ) { p -> state = RUNNABLE ; if ( p -> p_level == high ) { insert1 ( p ) ; } else if ( p -> p_level == middle ) { insert2 ( p ) ; } else { insert3 ( p ) ; } insert ( p ) ; } }
PAGEBREAK!
PAGEBREAK!