Interface WasiThreadModule
-
public interface WasiThreadModuleMarker interface forWasmModuleimplementations that support WASI threading.A
WasiThreadModuleprovides an entry point for threads spawned through the WASI threading API. When a new thread is created, thewasi_thread_start(int, int)method is invoked by the runtime with the appropriate thread and argument identifiers.This interface should be implemented by modules that are intended to participate in multi-threaded execution using WASI. Modules that do not implement this interface are considered single-threaded and will not receive thread start callbacks.
Implementation requirement: implementations must declare the
wasi_thread_startmethod asnativeandsynchronized, with the following signature:public native synchronized void wasi_thread_start(int threadId, int args);This requirement ensures that the method is bound to the
wasi_thread_startfunction exported by the underlying WASM module and can be safely invoked in a concurrent environment.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidwasi_thread_start(int threadId, int args)Entry point invoked when a new WASI thread is started.
-