public void proceed(int priority) throws InterruptedException {
synchronized (lock) {
    while (highestPriority < priority) {
      lock.wait();
    }
  }
}

public void proceed ( int priority ) throws InterruptedException { synchronized ( lock ) { while ( highestPriority < priority ) { lock . wait ( ) ; } } }
blocks until the passed priority is the lowest one ( i . e . highest priority ) .
