if(closed) throw new QueueClosedException();
    public void removeElement(Object obj) throws QueueClosedException {        Element el, tmp_el;        if(obj == null) {            if(log.isErrorEnabled()) log.error("argument must not be null");            return;        }        /*lock the queue*/        synchronized(mutex) {            el=head;            /*the queue is empty*/            if(el == null) return;            /*check to see if the head element is the one to be removed*/            if(el.obj.equals(obj)) {                /*the head element matched we will remove it*/                head=el.next;                el.next=null;                /*check if we only had one object left                 *at this time the queue becomes empty                 *this will set the tail=head=null                 */                if(size == 1)                    tail=head;  // null                decrementSize();//                if(size == 0) {//                    synchronized(remove_mutex) {//                        remove_mutex.notifyAll();//                    }//                }                return;            }            /*look through the other elements*/            while(el.next != null) {                if(el.next.obj.equals(obj)) {                    tmp_el=el.next;                    if(tmp_el == tail) // if it is the last element, move tail one to the left (bela Sept 20 2002)                        tail=el;                    el.next=el.next.next;  // point to the el past the next one. can be null.                    tmp_el.next=null;                    decrementSize();//                    if(size == 0) {//                        synchronized(remove_mutex) {//                            remove_mutex.notifyAll();//                        }//                    }                    break;                }                el=el.next;            }        }    }