Skip to content

[region-isolation] Require T in assumeIsolated<T> to be Sendable. #72763

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

Conversation

gottesmm
Copy link
Contributor

@gottesmm gottesmm commented Apr 2, 2024

I had to change the APIs to always be always emit into client instead of back deployable since silgen_name seems to interfere with @backDeployment. So I switched the implementation so that it instead uses an always emit into client thunk with the in source function name and a usableFromInline function that has the silgen_name. This ensures that we still appropriately export the same symbol as we did before, so it is ABI stable.

This was approved as part of se-0414.

rdar://122030520

@gottesmm gottesmm requested a review from ktoso as a code owner April 2, 2024 05:03
@gottesmm
Copy link
Contributor Author

gottesmm commented Apr 2, 2024

@swift-ci smoke test

@gottesmm gottesmm requested a review from tshortli April 2, 2024 05:12
@gottesmm
Copy link
Contributor Author

gottesmm commented Apr 2, 2024

@tshortli is it safe to do what I am doing here if a function was back deployed?

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.

The change itself LGTM though. I think it makes sense to prevent escaping non-sendable values out of an actor unsafely using the assumeIsolated { $0.state } trick 👍

@gottesmm gottesmm force-pushed the pr-d6b1f7e0bfc91f3d28ecf7bd100f45f41533688a branch 5 times, most recently from dae432a to 1c2f544 Compare April 2, 2024 18:55
@gottesmm
Copy link
Contributor Author

gottesmm commented Apr 2, 2024

@swift-ci test

@gottesmm
Copy link
Contributor Author

gottesmm commented Apr 2, 2024

@swift-ci smoke test linux platform

@gottesmm gottesmm enabled auto-merge April 2, 2024 20:07
I had to change the APIs to always be always emit into client instead of back
deployable since silgen_name seems to interfere with @backDeployment. So I
switched the implementation so that it instead uses an always emit into client
thunk with the in source function name and a usableFromInline function that has
the silgen_name. This ensures that we still appropriately export the same symbol
as we did before, so it is ABI stable.

This was approved as part of se-0414.

rdar://122030520
@gottesmm gottesmm force-pushed the pr-d6b1f7e0bfc91f3d28ecf7bd100f45f41533688a branch from 1c2f544 to cf93476 Compare April 2, 2024 20:49
@gottesmm
Copy link
Contributor Author

gottesmm commented Apr 2, 2024

@swift-ci test

@gottesmm
Copy link
Contributor Author

gottesmm commented Apr 2, 2024

@swift-ci smoke test

@gottesmm gottesmm disabled auto-merge April 3, 2024 00:12
@gottesmm
Copy link
Contributor Author

gottesmm commented Apr 3, 2024

@swift-ci smoke test

@gottesmm
Copy link
Contributor Author

gottesmm commented Apr 3, 2024

@swift-ci smoke test Linux platform

1 similar comment
@gottesmm
Copy link
Contributor Author

gottesmm commented Apr 3, 2024

@swift-ci smoke test Linux platform

@gottesmm
Copy link
Contributor Author

gottesmm commented Apr 3, 2024

@swift-ci smoke test macOS platform

@gottesmm gottesmm merged commit 302b010 into swiftlang:main Apr 3, 2024
@gottesmm gottesmm deleted the pr-d6b1f7e0bfc91f3d28ecf7bd100f45f41533688a branch April 3, 2024 06:47
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