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; }