public boolean isHeldByCurrentThread() {
        return lock.isHeldByCurrentThread();
    }
Queries if this lock is held by the current thread.

@return {@code true} if current thread holds this lock and {@code false} otherwise
@see ReentrantLock#isHeldByCurrentThread()
xmppserver/src/main/java/org/jivesoftware/util/AutoCloseableReentrantLock.java