Please do not open a pull request without first filing an issue and/or discussing the feature directly with me.
Please ensure you adhere to every item in this list
[x] This PR was pre-approved by the project maintainer
[x] I have self-reviewed the code
[ ] I have added all necessary tests
Describe your changes
When detaching a thread, there is a certain case where that pthread_t variable could be 0. On my system, pthread_detach(0) is causing a segfault, crashing the program. On other systems (and according to the man page), it shouldn't segfault but instead gracefully return an error code, however in that case it is still an error, and I believe it should be fixed in this way, in any case.
Please do not open a pull request without first filing an issue and/or discussing the feature directly with me.
Please ensure you adhere to every item in this list
Describe your changes
When detaching a thread, there is a certain case where that
pthread_t
variable could be 0. On my system,pthread_detach(0)
is causing a segfault, crashing the program. On other systems (and according to the man page), it shouldn't segfault but instead gracefully return an error code, however in that case it is still an error, and I believe it should be fixed in this way, in any case.Issue number and link
1