定义
一个阻塞式的队列,使用数据的数据结构继承自AbstractQueue
//返回 boolean 实际使用的是addpublic boolean add(E e) {if (this.offer(e)) {return true;} else {throw new IllegalStateException("Queue full");}}
//抛出异常public boolean offer(E e) {Objects.requireNonNull(e);ReentrantLock lock = this.lock;lock.lock();boolean var3;try {if (this.count != this.items.length) {this.enqueue(e);var3 = true;return var3;}var3 = false;} finally {lock.unlock();}return var3;}
// 阻塞public void put(E e) throws InterruptedException {Objects.requireNonNull(e);ReentrantLock lock = this.lock;lock.lockInterruptibly();try {while(this.count == this.items.length) {this.notFull.await();}this.enqueue(e);} finally {lock.unlock();}}
