Skip to content

CoreFoundation: introduce _CFMutex, _CFRecursiveMutex #1811

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
Jan 7, 2019

Conversation

compnerd
Copy link
Member

Introduce the _CFMutex and _CFRecursiveMutex types to allow us to
differentiate between recursive and non-recursive mutexes and be able to replace
them on different platforms. This codepath does not use CFLock_t as these are
expected to be full mutexes rather than unfair locks.

@compnerd
Copy link
Member Author

@parkera @phausler - okay, since the mutex changes seemed ... scary, how about this as an attempt to replace the pthread usage with something that we can reason about and move things around on Windows. Think that this is reasonable enough?

@compnerd compnerd force-pushed the whdiatdyosayu branch 2 times, most recently from 79e85fc to 8060f93 Compare December 18, 2018 21:45
@compnerd
Copy link
Member Author

@swift-ci please test

@compnerd
Copy link
Member Author

@swift-ci please test

@compnerd
Copy link
Member Author

@swift-ci please test

@compnerd
Copy link
Member Author

@swift-ci please test Linux platform

1 similar comment
@compnerd
Copy link
Member Author

@swift-ci please test Linux platform

@parkera
Copy link
Contributor

parkera commented Dec 20, 2018

This approach looks good to me.

@parkera parkera requested review from phausler and millenomi and removed request for phausler December 20, 2018 21:30
@parkera
Copy link
Contributor

parkera commented Dec 20, 2018

I double checked on the recursive thing and you're right that CFRunLoop uses it -- nowhere else as far as I can tell. Calling it out explicitly with the functions named like this is a great idea.

@compnerd
Copy link
Member Author

@swift-ci please test Linux platform

1 similar comment
@compnerd
Copy link
Member Author

@swift-ci please test Linux platform

Introduce the `_CFMutex` and `_CFRecursiveMutex` types to allow us to
differentiate between recursive and non-recursive mutexes and be able to replace
them on different platforms.  This codepath does not use `CFLock_t` as these are
expected to be full mutexes rather than unfair locks.
@compnerd
Copy link
Member Author

@swift-ci please test

@compnerd
Copy link
Member Author

compnerd commented Jan 2, 2019

@parkera / @phausler / @millenomi - okay to merge?

@compnerd
Copy link
Member Author

compnerd commented Jan 7, 2019

@parkera @millenomi @phausler ping?

@phausler
Copy link
Contributor

phausler commented Jan 7, 2019

I am going to defer to Tony on this one.

@parkera parkera self-requested a review January 7, 2019 21:26
@parkera
Copy link
Contributor

parkera commented Jan 7, 2019

Sorry for the delay, still catching up from the break.

@compnerd compnerd merged commit 60651e2 into swiftlang:master Jan 7, 2019
@compnerd compnerd deleted the whdiatdyosayu branch January 7, 2019 23:33
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