summaryrefslogtreecommitdiff
path: root/wasm2c/wasm-rt.h
diff options
context:
space:
mode:
authorKeith Winstein <keithw@cs.stanford.edu>2023-12-03 18:23:03 -0800
committerGitHub <noreply@github.com>2023-12-04 02:23:03 +0000
commit0362847b8a0d714a47c258a96d770f042cf72d5e (patch)
tree32be1b879fadec47e7acc8f87da5ffb3047fbd22 /wasm2c/wasm-rt.h
parent678026224f5f565600e923ad4510eaf7ed8a8cd8 (diff)
downloadwabt-0362847b8a0d714a47c258a96d770f042cf72d5e.tar.gz
wabt-0362847b8a0d714a47c258a96d770f042cf72d5e.tar.bz2
wabt-0362847b8a0d714a47c258a96d770f042cf72d5e.zip
w2c runtime: add per-thread init/free API (#2332)
Diffstat (limited to 'wasm2c/wasm-rt.h')
-rw-r--r--wasm2c/wasm-rt.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/wasm2c/wasm-rt.h b/wasm2c/wasm-rt.h
index 341ac445..a79271e3 100644
--- a/wasm2c/wasm-rt.h
+++ b/wasm2c/wasm-rt.h
@@ -331,6 +331,19 @@ bool wasm_rt_is_initialized(void);
/** Free the runtime's state. */
void wasm_rt_free(void);
+/*
+ * Initialize the multithreaded runtime for a given thread. Must be
+ * called by each thread (other than the one that called wasm_rt_init)
+ * before initializing a Wasm module or calling an exported
+ * function.
+ */
+void wasm_rt_init_thread(void);
+
+/*
+ * Free the individual thread's state.
+ */
+void wasm_rt_free_thread(void);
+
/**
* A hardened jmp_buf that allows checking for initialization before use
*/