私はのコードを見ていましたArrayBlockingQueue.put(E)
。notFull.signal
キャッチブロックでの呼び出しが本当に必要ですか?その信号は消費者によって呼び出されるべきではありませんか?
public void put(E e) throws InterruptedException {
if (e == null) throw new NullPointerException();
final E[] items = this.items;
final ReentrantLock lock = this.lock;
lock.lockInterruptibly();
try {
try {
while (count == items.length)
notFull.await();
} catch (InterruptedException ie) {
notFull.signal(); // propagate to non-interrupted thread
throw ie;
}
insert(e);
} finally {
lock.unlock();
}
}