private int numLocksHeldInThisVM() {
    int numLocksHeld = 0;
    synchronized (tokens) {
      for (DLockToken token : tokens.values()) {
        synchronized (token) {
          if (token.isLeaseHeld()) {
            numLocksHeld++;
          }
        }
      }
    }
    return numLocksHeld;
  }
Returns number of lock tokens currently leased by this member. Synchronizes on tokens map and
each lock token.

@return number of lock tokens currently leased by this member
geode-core/src/main/java/org/apache/geode/distributed/internal/locks/DLockService.java