@Override
  public boolean waitToStop(long timeout) throws InterruptedException {

    if (Thread.interrupted()) {
      throw new InterruptedException();
    }

    long start = System.currentTimeMillis();
    while (System.currentTimeMillis() - start < timeout) {
      if (!isRunning()) {
        return true;

      } else {
        Thread.sleep(100);
      }
    }

    return !isRunning();
  }
Polls to determine whether or not this managed entity has stopped.
geode-core/src/main/java/org/apache/geode/admin/internal/DistributionLocatorImpl.java