public void clear(){
  fullyLock();
  try {
    for (Node<E> p, h=head; (p=h.next) != null; h=p) {
      h.next=h;
      p.item=null;
    }
    head=last;
    if (count.getAndSet(0) == capacity)     notFull.signal();
  }
  finally {
    fullyUnlock();
  }
}

public void clear ( ) { fullyLock ( ) ; try { for ( Node < E > p , h = head ; ( p = h . next ) != null ; h = p ) { h . next = h ; p . item = null ; } head = last ; if ( count . getAndSet ( 0 ) == capacity ) notFull . signal ( ) ; } finally { fullyUnlock ( ) ; } }
atomically removes all of the elements from this queue . the queue will be empty after this call returns .
