Skip to content
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

fix the possibility for pthread_detach(0) #2

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

j4cobgarby
Copy link

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

  • This PR was pre-approved by the project maintainer
  • 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.

Issue number and link

#1

@tidwall tidwall merged commit ec26837 into tidwall:main Apr 10, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants