From 093a6f12bf85b089ed59cc49bc23b54e2f9e05b9 Mon Sep 17 00:00:00 2001 From: "Kristian S. Stangeland" Date: Fri, 18 Jan 2013 09:46:23 +0100 Subject: [PATCH] Properly exit BlockingHashMap#get if we time out. --- .../com/comphenix/protocol/concurrency/BlockingHashMap.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/concurrency/BlockingHashMap.java b/ProtocolLib/src/main/java/com/comphenix/protocol/concurrency/BlockingHashMap.java index df867951..54295cdb 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/concurrency/BlockingHashMap.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/concurrency/BlockingHashMap.java @@ -114,7 +114,10 @@ public class BlockingHashMap { if (remainingTime > 0) { TimeUnit.NANOSECONDS.timedWait(lock, remainingTime); value = backingMap.get(key); - } + } else { + // Timeout elapsed + break; + } } } }