Skip to content

nonisolated(unsafe) to opt out of strict concurrency static checking for global variables #69280

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

Conversation

sophiapoirier
Copy link
Contributor

This is a follow-up based on feedback from the pitch for strict concurrency for global variables that there is need for an opt-out mechanism when thread-safety is manually managed.

@@ -7832,6 +7833,14 @@ VarDecl *VarDecl::getLazyStorageProperty() const {
{});
}

bool VarDecl::isGlobalStorage() const {
if (!hasStorage()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be hasStorageOrWrapsStorage()? I wonder how this interacts with property wrapped static properties...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @xedin good point, and I addressed property wrapped static properties in the most recent commit.

@sophiapoirier sophiapoirier force-pushed the globals_strict_concurrency_opt_out_nonisolated_unsafe branch 3 times, most recently from 20528a0 to 1468b07 Compare October 26, 2023 21:57
@sophiapoirier sophiapoirier force-pushed the globals_strict_concurrency_opt_out_nonisolated_unsafe branch from cb1a2f8 to 4c9a726 Compare October 26, 2023 23:23
@sophiapoirier
Copy link
Contributor Author

@swift-ci please test

@sophiapoirier sophiapoirier merged commit 77e7dc2 into swiftlang:main Oct 27, 2023
@sophiapoirier sophiapoirier deleted the globals_strict_concurrency_opt_out_nonisolated_unsafe branch October 27, 2023 05:34
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.

2 participants