DLockToken getOrCreateToken(Object name) {
    synchronized (tokens) {
      checkDestroyed(); // check destroy after acquiring tokens map sync
      DLockToken token = tokens.get(name);
      boolean createNewToken = token == null;
      if (createNewToken) {
        token = new DLockToken(dm, name);
      }
      synchronized (token) {
        if (createNewToken) {
          tokens.put(name, token);
          if (logger.isTraceEnabled(LogMarker.DLS_VERBOSE)) {
            logger.trace(LogMarker.DLS_VERBOSE, "Creating {} in {}", token, this);
          }
          getStats().incTokens(1);
        }
        token.incUsage();
      }
      return token;
    }
  }
Returns an existing or creates a new DLockToken. Synchronizes on tokens map and the lock token.

@param name the name of the lock
@return an existing or new instantiated lock token
geode-core/src/main/java/org/apache/geode/distributed/internal/locks/DLockService.java