synchronized (prev) { prev.next = null; }
synchronized (prev) { prev.next = next; if (next != null) next.prev = prev;
	protected void pop() throws EmptyStackException {		if (prev == null)			throw new EmptyStackException();		// Don't synchronize both this and prev at the same time, or deadlock could		// occur.		synchronized (prev) {			prev.next = null;		}		synchronized (this) {			int i = next_out;			while (i != next_in) {				prev.postEvent(queue[i]);				next_out = i;				if (++i == queue.length)					i = 0;			}		}	}