protected void removeGrantIfUnused(DLockGrantToken grant) {
    synchronized (grantTokens) {
      synchronized (grant) {
        if (isDestroyed() || grant.isDestroyed()) {
          return;
        } else if (grant.grantLockToNextRequest()) {
          return;
        } else if (!grant.isBeingAccessed() && !grant.isGranted(false)
            && !grant.hasWaitingRequests()) {
          basicRemoveGrantToken(grant);
        }
      }
    }
  }
Remove the grant token if it is unused.
<p>
Synchronizes on grantTokens and the grant token.

@param grant the grant token to remove
geode-core/src/main/java/org/apache/geode/distributed/internal/locks/DLockGrantor.java