void awaitAvailableOutputIsRead()

in src/com/pty4j/windows/conpty/WinHandleInputStream.java [102:120]


  void awaitAvailableOutputIsRead() {
    myLock.lock();
    try {
      if (myReadCount == 0 && !myReadCountChanged.await(2000, TimeUnit.MILLISECONDS)) {
        LOG.warn("Nobody called " + WinHandleInputStream.class.getName() + ".read after the process creation!");
        return;
      }
      long start = System.currentTimeMillis();
      int oldReadCount;
      do {
        oldReadCount = myReadCount;
      } while (myReadCountChanged.await(100, TimeUnit.MILLISECONDS) &&
          oldReadCount < myReadCount &&
          System.currentTimeMillis() - start < 2000);
    } catch (InterruptedException ignored) {
    } finally {
      myLock.unlock();
    }
  }