Skip to content

[Concurrency] Ensure we get the right context for captured variables. #36117

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

DougGregor
Copy link
Member

The declaration context of an explicitly-captured value is the context
of the original, captured declaration itself... not the closure in which
the value is captured. Account for this in data race checking, by tracking
the effective capture context for such variables. This eliminates some
erroneous complains about accesses to explicitly-captured variables in
concurrent code.

Part of rdar://74281361.

The declaration context of an explicitly-captured value is the context
of the original, captured declaration itself... not the closure in which
the value is captured. Account for this in data race checking, by tracking
the effective capture context for such variables. This eliminates some
erroneous complains about accesses to explicitly-captured variables in
concurrent code.

Part of rdar://74281361.
We are only interest in local captures in very narrow places, and they
aren't actually related to actor isolation at all. Drop this case and
check local captures in the one place they matter.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor DougGregor merged commit a34b52c into swiftlang:main Feb 24, 2021
@DougGregor DougGregor deleted the explicit-capture-concurrency-checks branch February 24, 2021 07:10
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.

1 participant