protected synchronized boolean grantLockToRequest(DLockRequestMessage request) {
      Assert.assertTrue(request.getRemoteThread() != null);
      if (isGranted(true) || hasWaitingRequests()) {
        return false;
      }

      if (logger.isTraceEnabled(LogMarker.DLS_VERBOSE)) {
        logger.trace(LogMarker.DLS_VERBOSE, "[DLockGrantToken.grantLockToRequest] granting: {}",
            request);
      }

      long newLeaseExpireTime = grantAndRespondToRequest(request);
      if (newLeaseExpireTime == -1) {
        return false;
      }

      if (newLeaseExpireTime < Long.MAX_VALUE) {
        long now = DLockService.getLockTimeStamp(grantor.dm);
        grantor.thread.checkTimeToWait(newLeaseExpireTime - now, true);
      }

      return true;
    }
Grant this lock to the request if possible. Returns true if lock was granted to the request.
<p>
Synchronizes on this grant token.

@param request the lock request asking for this lock
@return true if lock was granted to the request
geode-core/src/main/java/org/apache/geode/distributed/internal/locks/DLockGrantor.java