int getHoldCount() 返回當(dāng)前線程調(diào)用lock()方法的次數(shù)。
int getQueueLength() 返回正等待獲得鎖的線程預(yù)估數(shù)。
int getWaitQueueLength(Condition condition) 返回與Condition條件相關(guān)的等待的線程預(yù)估數(shù)。
boolean hasQueuedThread(Thread thread) 查詢參數(shù)指定的線程是否在等待獲得鎖。
boolean hasQueuedThreads() 查詢是否還有線程在等待獲得該鎖。
boolean hasWaiters(Condition condition) 查詢是否有線程正在等待指定的Condition條件。
boolean isFair() 判斷是否為公平鎖。
boolean isHeldByCurrentThread() 判斷當(dāng)前線程是否持有該鎖。
boolean isLocked() 查詢當(dāng)前鎖是否被線程持有。