-
-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make pthread_self()
return a non-zero value in thread_pthread_stubs.h
#125161
Labels
Comments
I agree, it's better to fix WASI stubs. |
Fine by me! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently our stub for
pthread_self()
(used by WASI) just returns zero:cpython/Python/thread_pthread_stubs.h
Lines 106 to 109 in 37228bd
I propose we return a non-zero value for better consistency with functional pthread implementations. For example:
Why?
We occasionally assume that
PyThread_get_thread_ident_ex()
returns a non-zero value. For example:pystate.c
failing under WASI #110455_PyRecursiveMutex
for the owner field (oops)We can work around these issues with
#ifndef HAVE_PTHREAD_STUBS
or by fixing the_PyRecursiveMutex
implementation, but I think we might save ourselves a few headaches in the future by just making thepthread_self()
stub behave a bit more like actual pthread implementations.cc @brettcannon @kumaraditya303
Linked PRs
The text was updated successfully, but these errors were encountered: