public synchronized Status waitForResult() {
    if (wait) {
      while (status == Status.RUNNING) {
        try {
          this.wait();
        } catch (InterruptedException e) {
          logger.warn("Interrupted when waiting for result.", e);
          Thread.currentThread().interrupt();
          status = Status.FAILURE;
          break;
        }
      }
    }
    return status;
  }
Wait until getting the result. <br>
Notice: wait only when wait status is ture.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/utils/listener/AbstractResultListener.java