public boolean isHeldByThreadId(Object name, int threadId) {
    checkDestroyed();
    synchronized (tokens) {
      DLockToken token = basicGetToken(name);
      if (token == null) {
        return false;
      }
      synchronized (token) {
        token.checkForExpiration();
        if (token.getLesseeThread() == null) {
          return false;
        }
        return token.getLesseeThread().getThreadId() == threadId;
      }
    }
  }
Destroys and removes all lock tokens. Caller must synchronize on destroyLock. Synchronizes on
tokens map and each token.
geode-core/src/main/java/org/apache/geode/distributed/internal/locks/DLockService.java