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

[Concurrency] Handle actor isolation for defers in closures #60688

Merged
merged 1 commit into from Sep 1, 2022

Conversation

theblixguy
Copy link
Collaborator

@theblixguy theblixguy commented Aug 21, 2022

Resolves #58921
Resolves #57673

defer bodies share actor isolation with its parent context, so tweak getActorIsolationOfContext to handle defer (instead of doing it in a ad-hoc way). This method is called from a bunch of places so IMO it's better to handle it there. This also solves the bug where we were not handling defer in closures (but it worked fine in functions)

(edit by @kavon): also resolves rdar://92408225

@theblixguy theblixguy self-assigned this Aug 21, 2022
@theblixguy theblixguy force-pushed the defer-isolation-closures branch 2 times, most recently from 3ac0da6 to 5272509 Compare August 22, 2022 12:56
@theblixguy
Copy link
Collaborator Author

ping

Copy link
Contributor

@kavon kavon left a comment

Choose a reason for hiding this comment

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

Nice fix! This should also resolve rdar://92408225

@kavon
Copy link
Contributor

kavon commented Aug 31, 2022

@swift-ci please smoke test and merge

@kavon
Copy link
Contributor

kavon commented Aug 31, 2022

Hm seems CI is blocked on an unrelated lldb failure in lldb-shell :: SwiftREPL/BreakpointSimple.test

@kavon
Copy link
Contributor

kavon commented Aug 31, 2022

@swift-ci please smoke test and merge

@clayellis
Copy link

When will this change be released? It appears that the previous error is still present in Xcode 14.2 (14C18).

Main actor-isolated property 'isLoading' can not be mutated from the main actor

@theblixguy
Copy link
Collaborator Author

@clayellis The fix should be in 5.8 (Xcode 14.3 beta). It was only reverted from the 5.7 branch, not main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants