Skip to content

Commit 3005bf1

Browse files
committed
Add clarification for the return value of the wasi_thread_spawn function.
The documentation here was a bit vague; libc implementation alread assumed the return value to be a thread id; this is similar to posix's `clone`. I think using return value for thread ID makes sense in WASI, but I'm open for discussion.
1 parent 3c99793 commit 3005bf1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ The API consists of a single function. In pseudo-code:
9090
status wasi_thread_spawn(thread_start_arg* start_arg);
9191
```
9292
93+
where the `status` is a unique non-negative integer thread ID of the new
94+
thread or negative number representing an error in case the thread failed to
95+
start.
9396
The host implementing `wasi_thread_spawn` will call a predetermined function
9497
export (`wasi_thread_start`) in a new WebAssembly instance. Any necessary
9598
locking/signaling/thread-local storage will be implemented using existing

0 commit comments

Comments
 (0)