protected void checkTimeToWait(long newTimeToWaitArg, boolean expire) {
      long newTimeToWait = newTimeToWaitArg;
      if (newTimeToWait == Long.MAX_VALUE) {
        // never expire
        return;
      } else if (newTimeToWait < 0) {
        // negative means already expired or timed out so we wakeup immediately
        newTimeToWait = 0;
      }

      synchronized (lock) {
        if (expire && newTimeToWait < nextExpire) {
          nextExpire = newTimeToWait;
        }
        if (!expire && newTimeToWait < nextTimeout) {
          nextTimeout = newTimeToWait;
        }

        if (newTimeToWait < timeToWait) {
          if (waiting) {
            long newWakeupTimeStamp = now() + newTimeToWait;
            if (newWakeupTimeStamp > -1 // accounts for overflow
                && newWakeupTimeStamp < expectedWakeupTimeStamp) {
              timeToWait = newTimeToWait;
              requireTimeToWait = true;
              goIntoWait = true;
              lock.notify();
            }
          } else {
            timeToWait = newTimeToWait;
            requireTimeToWait = true;
          }
        } // end if newTimeToWait
      } // end sync this.lock
    }
Time in millis that next lock is due to expire
geode-core/src/main/java/org/apache/geode/distributed/internal/locks/DLockGrantor.java