void notifyOfThreadReleasingLock(Thread currentThread, String lockPath) {
        Thread oldThread = lockPathsHeld.remove(lockPath);
        if (oldThread == null) {
            getLockMetrics(lockPath).incrementNakedReleaseCount();
            logger.warning("Thread " + currentThread.getName() + " is releasing the lock " + lockPath +
                           ", but nobody owns that lock");
        } else if (oldThread != currentThread) {
            getLockMetrics(lockPath).incrementForeignReleaseCount();
            logger.warning("Thread " + currentThread.getName() +
                           " is releasing the lock " + lockPath + ", but it was owned by thread " +
                           oldThread.getName());
        }
    }
Must be invoked only before the last and non-reentry release of the lock.
zkfacade/src/main/java/com/yahoo/vespa/curator/stats/LockStats.java