public boolean suspendLockingInterruptibly(long waitTimeMillis, boolean interruptible)
      throws InterruptedException {
    checkDestroyed();

    boolean wasInterrupted = false;
    if (Thread.interrupted()) {
      if (interruptible) {
        throw new InterruptedException();
      } else {
        wasInterrupted = true;
      }
    }

    try {

      if (isLockingSuspendedByCurrentThread()) {
        throw new IllegalStateException(
            "Current thread has already locked entire service");
      }

      // have to use tryLock to avoid deadlock with other members that are
      // simultaneously attempting to suspend locking
      boolean tryLock = false; // go with false to queue up suspend lock requests
      // when tryLock is false, we get deadlock:
      // thread 1 is this thread
      // thread 2 is processing a SuspendMessage... goes thru
      // suspendLocking with distribute=false and gets stuck in
      // waitForGrantorCallsInProgress

      boolean gotToken = false;
      boolean keepTrying = true;

      long startTime = System.currentTimeMillis();
      long waitLimit = startTime + waitTimeMillis;
      if (waitLimit < 0) {
        waitLimit = Long.MAX_VALUE;
      }

      while (!gotToken && keepTrying) {
        gotToken =
            lockInterruptibly(SUSPEND_LOCKING_TOKEN, waitTimeMillis, -1, tryLock, interruptible,
                false);
        keepTrying = !gotToken && waitLimit > System.currentTimeMillis();
      }
      return gotToken;
    } finally {
      if (wasInterrupted) {
        Thread.currentThread().interrupt();
      }
    }
  }
Suspends granting of locks for this instance of DLockService. If distribute is true, sends
suspendLocking to all other members that have created this service. Blocks until all
outstanding locks have been released (excluding those held by the initial calling thread).

@param waitTimeMillis -1 means "wait forever", >=0 = milliseconds to wait

@return true if locking is suspended and all locks have been released. Otherwise, resumeLocking
        is invoked and false is returned.
geode-core/src/main/java/org/apache/geode/distributed/internal/locks/DLockService.java