Here you can find the source of getLockInfo(ReentrantLock lock)
private static String getLockInfo(ReentrantLock lock)
//package com.java2s; /************************************************************************************** * Copyright (C) 2008 EsperTech, Inc. All rights reserved. * * http://esper.codehaus.org * * http://www.espertech.com * * ---------------------------------------------------------------------------------- * * The software in this package is published under the terms of the GPL license * * a copy of which has been included with this distribution in the license.txt file. * **************************************************************************************/ import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.ReentrantReadWriteLock; public class Main { private static String getLockInfo(ReentrantLock lock) { String lockid = "Lock@" + Integer.toHexString(lock.hashCode()); return "lock " + lockid + " held=" + lock.getHoldCount() + " isHeldMe=" + lock.isHeldByCurrentThread() + " hasQueueThreads=" + lock.hasQueuedThreads(); }/*w ww. j av a2 s . com*/ private static String getLockInfo(ReentrantReadWriteLock lock) { String lockid = "RWLock@" + Integer.toHexString(lock.hashCode()); return lockid + " readLockCount=" + lock.getReadLockCount() + " isWriteLocked=" + lock.isWriteLocked(); } }