Skip to content

Allow thread.new-indirect to return -1 in case of resource exhaustion - #760

Merged
lukewagner merged 1 commit into
mainfrom
fallible-new-thread
Nov 3, 2026
Merged

lukewagner merged 1 commit into
mainfrom
fallible-new-thread

Conversation

@lukewagner

Copy link
Copy Markdown
Member

As suggested in #758

alexcrichton added a commit to WebAssembly/wasi-libc that referenced this pull request Nov 2, 2026
This commit is an adjustment to `pthread_create` on wasip3 with coop
threads enabled, specifically to account for
WebAssembly/component-model#760 where `thread.new-indirect` may fail.
The handling of errors here was also adjusted where -1 is now the only
failure code recognized from `thread.new-indirect` and limiting the
bounds of the created thread tid is validated only in successful spawns.
Additionally the return value isn't returned directly from the function,
but instead the `EAGAIN` symbolic constant is returned.
@lukewagner
lukewagner merged commit 38db7ee into main Nov 3, 2026
2 checks passed
@lukewagner
lukewagner deleted the fallible-new-thread branch November 3, 2026 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants