Closed FLYXH closed 5 months ago
public void put(E e) throws InterruptedException { checkNotNull(e); final ReentrantLock lock = this.lock; lock.lockInterruptibly(); try { //如果当前队列已满,将线程移入到notFull等待队列中 while (count == items.length) notFull.await(); //满足插入数据的要求,直接进行入队操作 enqueue(e); } finally { lock.unlock(); } }
注释不正确: //如果当前队列已满,将线程移入到notFull等待队列中 条件满足后,让notfull线程等待
OK,已经修复了。感谢指正。
public void put(E e) throws InterruptedException { checkNotNull(e); final ReentrantLock lock = this.lock; lock.lockInterruptibly(); try { //如果当前队列已满,将线程移入到notFull等待队列中 while (count == items.length) notFull.await(); //满足插入数据的要求,直接进行入队操作 enqueue(e); } finally { lock.unlock(); } }
注释不正确: //如果当前队列已满,将线程移入到notFull等待队列中 条件满足后,让notfull线程等待