Clean up shutdown of async queue
This commit is contained in:
parent
f335641eab
commit
1253ac2e6a
1 changed files with 9 additions and 5 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue