Skip to content

[Concurrency] Use pthread_specific for thread-local storage on Darwin. #38162

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

Merged
merged 1 commit into from
Jul 2, 2021

Conversation

mikeash
Copy link
Contributor

@mikeash mikeash commented Jun 29, 2021

The pthread_specific APIs are better than C++ thread_local storage on Darwin since we can use Swift's reserved pthread keys there.

rdar://79504652

The pthread_specific APIs are better than C++ thread_local storage on Darwin since we can use Swift's reserved pthread keys there.

rdar://79504652
@mikeash
Copy link
Contributor Author

mikeash commented Jun 29, 2021

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 190d3fd

Copy link
Contributor

@ktoso ktoso left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! Nice to use it for the locals as well, and if we run out of keys we can change that piece.

Thanks, Mike!

@mikeash
Copy link
Contributor Author

mikeash commented Jul 1, 2021

@swift-ci please test

@mikeash
Copy link
Contributor Author

mikeash commented Jul 2, 2021

@swift-ci please test windows platform

@mikeash
Copy link
Contributor Author

mikeash commented Jul 2, 2021

The Windows failure is unrelated, merging.

@mikeash mikeash merged commit 2d6a692 into swiftlang:main Jul 2, 2021
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.

3 participants