Exemplo n.º 1
0
 public Object readObject() throws EOFException {
   synchronized (queue) {
     while (queue.isEmpty())
       try {
         Thread.sleep(250);
       } catch (InterruptedException e) {
       }
     return queue.poll();
   }
 }
Exemplo n.º 2
0
 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();
   }
 }
Exemplo n.º 3
0
 public void writeObject(Object o) throws IOException {
   queue.add(o);
 }