getHoldCount/getQueueLength/getWaitQueueLength区别

Lock lock = new ReentrantLock();

Condition cond = lock.newCondition();

lock.getHoldCount(): 获取保持锁定的线程数(lock中的数量);

lock.getQueueLength(): 获取等待获取锁定的线程数;

lock.getWaitQueueLength(cond): 获取cond.await中的线程数量;

你可能感兴趣的:(getHoldCount/getQueueLength/getWaitQueueLength区别)