public Map<String, String> listThreadsHoldingLock() {

    Map<Object, DLockToken> tokenMap = lockService.snapshotService();
    Iterator<Object> it = tokenMap.keySet().iterator();
    Map<String, String> listOfLocks = new HashMap<>();
    int j = 0;
    while (it.hasNext()) {
      Object lockObject = it.next();
      DLockToken token = tokenMap.get(lockObject);
      if (token.getUsageCount() > 0) {
        listOfLocks.put(lockObject.toString(), token.getThreadName());
      }
    }

    return listOfLocks;

  }
Returns a list of thread which are blocked on some Object

@return map of object Name and thread holding lock on that object
geode-core/src/main/java/org/apache/geode/management/internal/beans/LockServiceMBeanBridge.java