Skip to content

Latest commit

 

History

History
40 lines (29 loc) · 786 Bytes

wasi-threads.wit.md

File metadata and controls

40 lines (29 loc) · 786 Bytes

WASI threads API

WASI threads is an API for thread creation.

Its goal is to provide functions that allow implementation of a subset of pthreads API, but it doesn't aim to be 100% compatible with POSIX threads standard.

thread-id

/// Unique thread identifier.
type thread-id = u32

start-arg

/// A reference to data passed to the start function (`wasi_thread_start()`) called by the newly spawned thread.
type start-arg = u32

errno

/// Error codes returned by the `thread-spawn` function.
enum errno {
    /// TBD
    eagain,
}

thread_spawn

/// Creates a new thread.
thread-spawn: func(
    /// A value being passed to a start function (`wasi_thread_start()`).
    start-arg: start-arg,
) -> result<thread-id, errno>