protected boolean waitRemoval() {
    boolean result;
    synchronized (isMarkedForRemovalLock) {
      result = isMarkedForRemoval;
      boolean interrupted = false;
      try {
        while (isMarkedForRemoval) {
          if (logger.isDebugEnabled()) {
            logger.debug("Waiting for CacheClientProxy removal: {}", this);
          }
          try {
            isMarkedForRemovalLock.wait();
          } catch (InterruptedException e) {
            interrupted = true;
            _cache.getCancelCriterion().checkCancelInProgress(e);
          }
        } // while
      } finally {
        if (interrupted) {
          Thread.currentThread().interrupt();
        }
      }
    } // synchronized
    return result;
  }
Wait until the receiver's removal has completed before returning.

@return true if the proxy was initially marked for removal
geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxy.java