private void waitWhileInitiatingTransfer(GrantorInfo gi) {
    synchronized (this) {
      boolean interrupted = false;
      try {
        while (gi.isInitiatingTransfer()) {
          try {
            wait();
          } catch (InterruptedException e) {
            interrupted = true;
            dm.getCancelCriterion().checkCancelInProgress(e);
          }
        }
      } finally {
        if (interrupted) {
          Thread.currentThread().interrupt();
        }
      }
    }
  }
Atomically clears the current grantor of the given service if the current grantor is
<code>oldGrantor</code>. The next grantor for this service will not need to recover unless
<code>locksHeld</code> is true.

@param locksHeld true if old grantor had held locks
geode-core/src/main/java/org/apache/geode/distributed/internal/locks/ElderState.java