public synchronized void put ( final Object o ) { final Bucket b = new Bucket ( o ) ; if ( tail != null ) { tail . setNext ( b ) ; tail = b ; } else { // queue was empty but has one element now head = tail = b ; } count ++ ; // notify any waiting tasks notify ( ) ; }
Add an object to the tail of the queue .