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

Unsafe*Pointer types should not be Sendable. #39218

Merged
merged 2 commits into from
Dec 7, 2021

Conversation

atrick
Copy link
Contributor

@atrick atrick commented Sep 9, 2021

To send them across actors, they need to be wrapped in an '@unchecked
Sendable' type. Typically such a wrapper type would be be responsible
for ensuring its uniqueness or immutability.

Inferring Sendability for arbitrary types that contain Unsafe*Pointers
would introduce race conditions without warning or any explicit
acknoledgement from the programmer that the pointer is in fact unique.

@atrick atrick changed the title Unsafe*Pointer types should not be sendable. Unsafe*Pointer types should not be Sendable. Sep 9, 2021
To send them across actors, they need to be wrapped in an '@unchecked
Sendable' type. Typically such a wrapper type would be be responsible
for ensuring its uniqueness or immutability.

Inferring Sendability for arbitrary types that contain Unsafe*Pointers
would introduce race conditions without warning or any explicit
acknoledgement from the programmer that the pointer is in fact unique.
@atrick atrick force-pushed the revoke-pointer-sendable branch from d00c380 to 47cc279 Compare December 6, 2021 23:54
@atrick atrick marked this pull request as ready for review December 6, 2021 23:55
@atrick atrick requested review from lorentey and DougGregor December 6, 2021 23:55
@atrick
Copy link
Contributor Author

atrick commented Dec 6, 2021

@swift-ci test

@atrick
Copy link
Contributor Author

atrick commented Dec 7, 2021

@swift-ci smoke test

Copy link
Member

@lorentey lorentey left a comment

Choose a reason for hiding this comment

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

This looks good to me! 🚢

@swift-ci
Copy link
Contributor

swift-ci commented Dec 7, 2021

Build failed
Swift Test Linux Platform
Git Sha - 47cc279

@swift-ci
Copy link
Contributor

swift-ci commented Dec 7, 2021

Build failed
Swift Test OS X Platform
Git Sha - 47cc279

@atrick
Copy link
Contributor Author

atrick commented Dec 7, 2021

@swift-ci smoke test

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