queue.add(r); notify();
for(;;) { if (queue.isEmpty()) try {wait();} catch (InterruptedException e){} //Need to check again, in case the we were interrupted if (!queue.isEmpty()) return (Request) queue.pop(); }