Clean up shutdown of async queue

This commit is contained in:
Mike Primm 2011-10-08 12:24:27 +08:00 committed by mikeprimm
parent f335641eab
commit 1253ac2e6a

View File

@ -36,12 +36,16 @@ public class AsynchronousQueue<T> {
return true;
}
private T pop() throws InterruptedException {
T t = queue.take();
synchronized (lock) {
set.remove(t);
private T pop() {
try {
T t = queue.take();
synchronized (lock) {
set.remove(t);
}
return t;
} catch (InterruptedException ix) {
return null;
}
return t;
}
public boolean remove(T t) {