public static void sleepWithoutInterrupt(final long timeToSleep) {
    long currentTime = System.currentTimeMillis();
    final long endTime = timeToSleep + currentTime;
    boolean interrupted = false;
    while (currentTime < endTime) {
      try {
        Thread.sleep(endTime - currentTime);
      } catch (final InterruptedException e) {
        interrupted = true;
      }
      currentTime = System.currentTimeMillis();
    }
    if (interrupted) {
      Thread.currentThread().interrupt();
    }
  }
Waiting until the specific procedure finished.

@param procedure The specific procedure
@return TSStatus the running result of this procedure
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/ProcedureManager.java