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

Use pthread_equal for pthread_t comparison #3022

Merged
merged 1 commit into from
Aug 25, 2021
Merged

Use pthread_equal for pthread_t comparison #3022

merged 1 commit into from
Aug 25, 2021

Conversation

justinboswell
Copy link
Contributor

Resolved issues:

Fixes issues called out in: #3011

Description of changes:

Per the documentation, it is not correct to compare pthread_t values with ==, pthread_equal is the correct API.

Call-outs:

Had to add a separate bool to denote initialization via s2n_init, as there is no defined invalid value for pthread_t. No implementation currently ever returns 0 for a thread ID, but that doesn't mean they can't.

Testing:

Tested downstream in the use-cases that necessitated the original changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link
Contributor

@baldwinmatt baldwinmatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alexw91 alexw91 merged commit b5b313b into main Aug 25, 2021
@alexw91 alexw91 deleted the pthread_equal branch August 25, 2021 00:38
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.

5 participants