public void waitUntilDone(){
  countLock.lock();
  try {
    equalCountCv.await();
  }
 catch (  InterruptedException e) {
    throw new RuntimeException("Shouldn't happen!");
  }
 finally {
    countLock.unlock();
  }
}

public void waitUntilDone ( ) { countLock . lock ( ) ; try { equalCountCv . await ( ) ; } catch ( InterruptedException e ) { throw new RuntimeException ( "Shouldn't happen!" ) ; } finally { countLock . unlock ( ) ; } }
wait for the number of finished jobs to equal to the number of submitted jobs .
