From 5ec05b9446752b506eaeefe1c1680b44677f577a Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Tue, 23 Jan 2018 22:08:44 +0300 Subject: [PATCH] Fix lock on overflow/underflow in ArrayBlockingQueue --- .../classlib/java/util/concurrent/TArrayBlockingQueue.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/classlib/src/main/java/org/teavm/classlib/java/util/concurrent/TArrayBlockingQueue.java b/classlib/src/main/java/org/teavm/classlib/java/util/concurrent/TArrayBlockingQueue.java index d75603955..4d0677c74 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/util/concurrent/TArrayBlockingQueue.java +++ b/classlib/src/main/java/org/teavm/classlib/java/util/concurrent/TArrayBlockingQueue.java @@ -417,7 +417,8 @@ public class TArrayBlockingQueue extends TAbstractQueue implements TBlocki } if (waitHandlers != null) { while (!waitHandlers.isEmpty()) { - Platform.postpone(() -> waitHandlers.remove().changed()); + WaitHandler handler = waitHandlers.remove(); + Platform.postpone(() -> handler.changed()); } waitHandlers = null; }