Lock lock = new ReentrantLock();
Condition cond = lock.newCondition();
lock.getHoldCount(): 获取保持锁定的线程数(lock中的数量);
lock.getQueueLength(): 获取等待获取锁定的线程数;
lock.getWaitQueueLength(cond): 获取cond.await中的线程数量;
Lock lock = new ReentrantLock();
Condition cond = lock.newCondition();
lock.getHoldCount(): 获取保持锁定的线程数(lock中的数量);
lock.getQueueLength(): 获取等待获取锁定的线程数;
lock.getWaitQueueLength(cond): 获取cond.await中的线程数量;
本文标题:getHoldCount/getQueueLength/getW
本文链接:https://www.haomeiwen.com/subject/jpxukftx.html
网友评论