public Object readObject() throws EOFException { synchronized (queue) { while (queue.isEmpty()) try { Thread.sleep(250); } catch (InterruptedException e) { } return queue.poll(); } }
public Object peekObject() throws EOFException { assert false : "Local match shouldn't have best-of-3 early termination"; synchronized (queue) { while (queue.isEmpty()) { try { Thread.sleep(250); } catch (InterruptedException e) { } } return queue.peek(); } }
public void writeObject(Object o) throws IOException { queue.add(o); }