public void destroyAndRemove() {
    // isLockGrantor determines if we need to tell elder of destroy
    boolean isCurrentlyLockGrantor = false;
    boolean isMakingLockGrantor = false;

    // maybeHasActiveLocks determines if we need to tell grantor of destroy
    boolean maybeHasActiveLocks = false;

    synchronized (creationLock) {
      try {
        synchronized (services) {
          try {
            if (isDestroyed()) {
              return;
            }
            setDestroyingThread();
            synchronized (lockGrantorIdLock) { // force ordering in lock request
              synchronized (destroyLock) {
                destroyed = true;
                maybeHasActiveLocks = activeLocks > 0;
              }
              isCurrentlyLockGrantor = isCurrentlyLockGrantor();
              isMakingLockGrantor = isMakingLockGrantor();
            }
          } finally {
            if (isCurrentThreadDoingDestroy()) {
              removeLockService(this);
            }
          }
        } // services sync
      } catch (CancelException e) {
        // don't report to caller
      } finally {
        if (isCurrentThreadDoingDestroy()) {
          try {
            basicDestroy(isCurrentlyLockGrantor, isMakingLockGrantor, maybeHasActiveLocks);
          } catch (CancelException e) {
            // don't propagate
          } finally {
            clearDestroyingThread();
          }
        }
        postDestroyAction();
      }
    } // creationLock sync
  }
Destroys an existing service and removes it from the map

@since GemFire 3.5
geode-core/src/main/java/org/apache/geode/distributed/internal/locks/DLockService.java