/** * Get the next object, block until available. */ public T get() { synchronized (access) { while (rpos == wpos) try { access.wait(); } catch (InterruptedException e) { } Object result = data[rpos]; rpos = advance(rpos); access.notifyAll(); return (T) result; } }