From ec21f2d8e14c4b79be7ba20c64deee729ca1f321 Mon Sep 17 00:00:00 2001 From: Matt McHenry Date: Fri, 4 Oct 2019 09:49:01 -0400 Subject: [PATCH] mark threading primitives unsupported on wasm this gives much clearer feedback, at build time rather than runtime, when attempting to use TeaVM with code that uses these operations. --- core/src/main/java/org/teavm/runtime/EventQueue.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/main/java/org/teavm/runtime/EventQueue.java b/core/src/main/java/org/teavm/runtime/EventQueue.java index e60d6be7d..3e656e559 100644 --- a/core/src/main/java/org/teavm/runtime/EventQueue.java +++ b/core/src/main/java/org/teavm/runtime/EventQueue.java @@ -18,7 +18,9 @@ package org.teavm.runtime; import java.util.Arrays; import org.teavm.backend.c.intrinsic.RuntimeInclude; import org.teavm.interop.Import; +import org.teavm.interop.Platforms; import org.teavm.interop.StaticInit; +import org.teavm.interop.UnsupportedOn; @StaticInit public final class EventQueue { @@ -127,10 +129,12 @@ public final class EventQueue { @Import(name = "teavm_waitFor") @RuntimeInclude("fiber.h") + @UnsupportedOn(Platforms.WEBASSEMBLY) private static native void waitFor(long time); @Import(name = "teavm_interrupt") @RuntimeInclude("fiber.h") + @UnsupportedOn(Platforms.WEBASSEMBLY) private static native void interrupt(); private static void ensureCapacity(int capacity) {