code: public void waitFor(Condition condition) {
          boolean    intr=false;
          lock.lock();
          try {
              while(!condition.isMet()) {
                  try {
                      cond.await();
                  }
                  catch(InterruptedException e) {
                      intr=true;
                  }
              }
          }
          finally {
              lock.unlock();
              if(intr) Thread.currentThread().interrupt();
          }
      }
docs: Blocks until condition is true.
  @param condition The condition. Must be non-null