public boolean await(long timeout,TimeUnit timeUnit) throws InterruptedException {
  boolean awaitResult=false;
  lock.lock();
  boolean localIsDone;
  try {
    awaitResult=done.await(timeout,timeUnit);
  }
  finally {
    localIsDone=isDone;
    isDone=false;
    lock.unlock();
  }
  return awaitResult && localIsDone;
}

public boolean await ( long timeout , TimeUnit timeUnit ) throws InterruptedException { boolean awaitResult = false ; lock . lock ( ) ; boolean localIsDone ; try { awaitResult = done . await ( timeout , timeUnit ) ; } finally { localIsDone = isDone ; isDone = false ; lock . unlock ( ) ; } return awaitResult && localIsDone ; }
inner implementation for supporting the blockingexecutor . await ( timeout , timeunit ) .
