InvocationCallback queuePoll ( ) { InvocationCallback element ; synchronized ( this ) { if ( tail != head ) { element = elements [ head & mask ] ; head ++ ; } else { element = null ; frozen = true ; } } return element ; }
Remove one handler from the deque or freeze the deque if there are no more elements .