Code example for Lock

Methods: newCondition

0
      new ArrayBlockingQueue<UIAScriptRequest>(1);
  private final BlockingQueue<UIAScriptResponse> responseQueue =
      new ArrayBlockingQueue<UIAScriptResponse>(1);
 
  private final Lock lock = new ReentrantLock();
  private final Condition condition = lock.newCondition();
  private volatile boolean ready = false;
 
  public boolean waitForUIScriptToBeStarted() throws InterruptedException { 
    try { 
      lock.lock();
      if (ready) {
        return true; 
      } 
      return condition.await(60, TimeUnit.SECONDS);
    } finally { 
      lock.unlock();
    } 
  } 
 
  public void registerUIAScript() {