public void put ( E e ) throws InterruptedException { Objects . requireNonNull ( e ) ; final ReentrantLock lock = this . lock ; lock . lockInterruptibly ( ) ; try { while ( count == items . length ) notFull . await ( ) ; enqueue ( e ) ; } finally { lock . unlock ( ) ; } }
Inserts the specified element at the tail of this queue waiting for space to become available if the queue is full .