From 1253ac2e6a661be70556d7de68ddd88163ae6c79 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Sat, 8 Oct 2011 12:24:27 +0800 Subject: [PATCH] Clean up shutdown of async queue --- src/main/java/org/dynmap/AsynchronousQueue.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/dynmap/AsynchronousQueue.java b/src/main/java/org/dynmap/AsynchronousQueue.java index 6d3637e2..74be3aa7 100644 --- a/src/main/java/org/dynmap/AsynchronousQueue.java +++ b/src/main/java/org/dynmap/AsynchronousQueue.java @@ -36,12 +36,16 @@ public class AsynchronousQueue { 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) {