Resolve deadlock seen after latest changes

* AbstractFrontier
    (drainInbound) don't assume current thread will be able to take() full batch; poll() and exit early if other threads have drained queue first
This commit is contained in:
gojomo committed 2010-11-08 18:54:03 +00:00
1 parent f12e940edd
commit 3be9941f76
1 file changed
+4 -1
@@ -473,7 +473,10 @@ public abstract class AbstractFrontier
protected void drainInbound() throws InterruptedException {
int batch = inbound.size();
for(int i = 0; i < batch; i++) {
InEvent ev = inbound.take();
InEvent ev = inbound.poll();
if(ev==null) {
break;
}
synchronized(this) {
ev.process();
}