Return an element from the head of the queue.
The element is removed from the queue.
Entry<V> first = null ;
V value = null ;
first = head.next ;
if (first == head)
return null ;
else {
value = first.handle().value() ;
// assert that the following expression returns true!
first.handle().remove() ;
}
// Once first is removed from the queue, it is invisible to other threads,
// so we don't need to synchronize here.
first.next = null ;
first.prev = null ;
return value ;