Use musl's pthread_detach#12861
Conversation
6b31998 to
1916fcc
Compare
1916fcc to
6a991ef
Compare
| #include "pthread_impl.h" | ||
| #include <threads.h> | ||
|
|
||
| // XXX Emscripten implements pthread_exit directly rather than __pthread_exit |
There was a problem hiding this comment.
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
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.