Properly exit BlockingHashMap#get if we time out.

This commit is contained in:
Kristian S. Stangeland 2013-01-18 09:46:23 +01:00
parent 95438c1861
commit 093a6f12bf

View File

@ -114,7 +114,10 @@ public class BlockingHashMap<TKey, TValue> {
if (remainingTime > 0) { if (remainingTime > 0) {
TimeUnit.NANOSECONDS.timedWait(lock, remainingTime); TimeUnit.NANOSECONDS.timedWait(lock, remainingTime);
value = backingMap.get(key); value = backingMap.get(key);
} } else {
// Timeout elapsed
break;
}
} }
} }
} }