[3.12] gh-101538: Add experimental wasi-threads build (GH-101537) (#106834)

(cherry picked from commit d8f87cdf94)

Co-authored-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
This commit is contained in:
Miss Islington (bot) 2023-07-17 15:31:17 -07:00 committed by GitHub
parent 941ac1e19d
commit e903c16a6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 53 additions and 3 deletions

View file

@ -356,7 +356,15 @@ PyThread_exit_thread(void)
{
if (!initialized)
exit(0);
#if defined(__wasi__)
/*
* wasi-threads doesn't have pthread_exit right now
* cf. https://github.com/WebAssembly/wasi-threads/issues/7
*/
abort();
#else
pthread_exit(0);
#endif
}
#ifdef USE_SEMAPHORES