You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: proposals/0423-dynamic-actor-isolation.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,7 +83,7 @@ This proposal adds dynamic actor isolation checking to:
83
83
84
84
Similarly to the previous case if a class or its individual synchronous members are actor-isolated and marked as either `@objc` or `@objcMembers`, the thunks, synthesized by the compiler to make them available from Objective-C, would have a new precondition check to make sure that use always happens on the right actor.
85
85
86
-
- Synchronous actorisolated function values passed to APIs that erase actor isolation and haven't yet adopted strict concurrency checking.
86
+
- Synchronous actor-isolated function values passed to APIs that erase actor isolation and haven't yet adopted strict concurrency checking.
87
87
88
88
When API comes from a module that doesn't have strict concurrency checking enabled it's possible that it could introduce actor isolation violations that would not be surfaced to a client. In such cases actor isolation erasure should be handled defensively by introducing a runtime check at each position for granular protection.
89
89
@@ -101,7 +101,7 @@ This proposal adds dynamic actor isolation checking to:
101
101
funcupdateUI(view: MyViewController) {
102
102
NotMyLibrary.track({
103
103
MainActor.assumeIsolated {
104
-
view.renderToUIEvent()
104
+
view.renderToUIEvent()
105
105
}
106
106
})
107
107
}
@@ -142,7 +142,7 @@ Runtime checking for actor isolation is not necessary for `async` functions, bec
142
142
143
143
### `@preconcurrency` conformances
144
144
145
-
A `@preconcurrency` protocol conformance is scoped to the implementation of the protocol requirements in the conforming type. A `@preconcurrency` conformance can be written at the primary declartaion or in an extension, and witness checker diagnostics about actor isolation will be suppressed. Like other `@preconcurrency` annotations, if no diagnotsics are suppressed, a warning will be emitted at the `@preconcurrency` annotation stating that the annotation has no effect and it should be removed.
145
+
A `@preconcurrency` protocol conformance is scoped to the implementation of the protocol requirements in the conforming type. A `@preconcurrency` conformance can be written at the primary declaration or in an extension, and witness checker diagnostics about actor isolation will be suppressed. Like other `@preconcurrency` annotations, if no diagnotsics are suppressed, a warning will be emitted at the `@preconcurrency` annotation stating that the annotation has no effect and it should be removed.
146
146
147
147
### Disabling dynamic actor isolation checking
148
148
@@ -170,7 +170,7 @@ The current approach in this proposal has a very desirable property of eliminate
170
170
171
171
### `@preconcurrency(unsafe)` to downgrade dynamic actor isolation violations to warnings
172
172
173
-
If adoption of this feature exposes a bug in existing binaries because actorisolated code from outside the actor, a `@preconcurrency(unsafe)` annotation (or similar) could be provided to downgrade assertion failures to warnings. However, it's not clear whether allowing a known data race exhibited at runtime is the right approach to solving such a problem.
173
+
If adoption of this feature exposes a bug in existing binaries because actor-isolated code is run outside the actor, a `@preconcurrency(unsafe)` annotation (or similar) could be provided to downgrade assertion failures to warnings. However, it's not clear whether allowing a known data race exhibited at runtime is the right approach to solving such a problem.
0 commit comments