-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Use musl's pthread_detach #12861
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
Use musl's pthread_detach #12861
Conversation
6b31998
to
1916fcc
Compare
1916fcc
to
6a991ef
Compare
@@ -1,6 +1,11 @@ | |||
#include "pthread_impl.h" | |||
#include <threads.h> | |||
|
|||
// XXX Emscripten implements pthread_exit directly rather than __pthread_exit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is about pthread_exit? Should it instead say about pthread_join?
How big of a difference was this for code size? This PR should definitely be run against https://github.com/juj/posixtestsuite to verify that the new implementation is still conformant, or if not, check if there is a good reason not to be. Pthread detach tests are at https://github.com/juj/posixtestsuite/tree/master/conformance/interfaces/pthread_detach |
OK, I'll hold off until I can at least run the testsuite. Surely we need to integrate that testsuite somehow? Otherwise we can't know if any of our changes are safe right? Should I open a bug to do that? |
Also, assuming we can find a test that fails, but also fails in upstream musl, can we agree that that is acceptable. i.e. there is no need for us to be more conformant the musl itself? I think that same statement is mostly true for the rest of libc too. |
6a991ef
to
6c3ade1
Compare
Adding posixtestsuite in #12923 |
7fea52b
to
79214d1
Compare
79214d1
to
4cf5eb6
Compare
Reviving this patch. We now run posixtest suite are part of CI and I also ran it locally to confirm everything passes. I did have to patch in a couple of extra checks that musl was overlooking. |
4cf5eb6
to
c083999
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
efac5d6
to
0a396d6
Compare
1791d74
to
c1cb3c0
Compare
The musl version handles that case where pthread_detach is called on a thread that is in the middle of exit'ing.
c1cb3c0
to
6e9e10d
Compare
The musl version handles that case where pthread_detach is called
on a thread that is in the middle of exit'ing.