question: public E poll ( long timeout , TimeUnit unit ) throws InterruptedException { long nanos = unit . toNanos ( timeout ) ; final ReentrantLock lock = this . lock ; lock . lockInterruptibly ( ) ; long t = now ( ) ; TenantQueue . Item item = null ; try { for ( ; ; ) { TenantQueue q = nextQueue ( t ) ; if ( q == null ) { if ( nanos <= 0 ) return null ; else nanos = available . awaitNanos ( nanos ) ; } else { long delay = q . next - t ; if ( delay <= 0 ) { item = q . poll ( t ) ; return item == null ? null : item . element ; } if ( nanos <= 0 ) return null ; if ( nanos < delay || leader != null ) nanos = available . awaitNanos ( nanos ) ; else { Thread thisThread = Thread . currentThread ( ) ; leader = thisThread ; try { long timeLeft = available . awaitNanos ( delay ) ; nanos -= delay - timeLeft ; } finally { if ( leader == thisThread ) leader = null ; } } } t = System . nanoTime ( ) ; } } finally { if ( leader == null && hasNext ( ) ) available . signal ( ) ; lock . unlock ( ) ; done ( item , t ) ; } }
target:  Retrieves and removes the head of this queue, waiting if necessary until an element with an expired delay is available on this queue, or the specified wait time expires.