public T remove ( ) { lock . lock ( ) ; try { if ( queue . isEmpty ( ) ) return null ; El < T > el = queue . poll ( ) ; count -= el . size ; not_full . signalAll ( ) ; return el . el ; } finally { lock . unlock ( ) ; } }
Removes and returns the first element or null if the queue is empty