]> git.proxmox.com Git - wasi-libc.git/blobdiff - libc-bottom-half/headers/public/wasi/api.h
__wasi_thread_spawn: stop truncating the return value (#353)
[wasi-libc.git] / libc-bottom-half / headers / public / wasi / api.h
index 7bbe93508e8468070ad5ca58c62e0609f548212e..45a6506e2ffa022e081bea9aa8e14cf8b7c4da5a 100644 (file)
@@ -2089,6 +2089,25 @@ __wasi_errno_t __wasi_sock_shutdown(
 ) __attribute__((__warn_unused_result__));
 /** @} */
 
+#ifdef _REENTRANT
+/**
+ * Request a new thread to be created by the host.
+ *
+ * The host will create a new instance of the current module sharing its
+ * memory, find an exported entry function--`wasi_thread_start`--, and call the
+ * entry function with `start_arg` in the new thread.
+ *
+ * @see https://github.com/WebAssembly/wasi-threads/#readme
+ */
+int32_t __wasi_thread_spawn(
+    /**
+     * A pointer to an opaque struct to be passed to the module's entry
+     * function.
+     */
+    void *start_arg
+)  __attribute__((__warn_unused_result__));
+#endif
+
 #ifdef __cplusplus
 }
 #endif