Skip to content

Commit db86206

Browse files
authored
[SE-0424]: Change checkIsolation() to checkIsolated() (#2650)
Before this change, the proposal was inconsistent in naming the proposed API: - 4 instances of `checkIsolation()` - 9 instances of `checkIsolated()` As far as I can tell from the Git history, this discrepancy has been there during the review period, so it's a little unclear which name has actually been accepted ;-). This change unifies the name to `checkIsolated()` because that's the actual name of the API in Swift 6.0.
1 parent 1732c11 commit db86206

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

proposals/0424-custom-isolation-checking-for-serialexecutor.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ One way to think of this proposal is that gives all `SerialExecutor`s the power
5454

5555
We propose to add a new last-resort mechanism to executor comparison, which will be used by all the isolation-checking APIs in the concurrency library.
5656

57-
This will be done by providing a new `checkIsolation()` protocol requirement on `SerialExecutor`:
57+
This will be done by providing a new `checkIsolated()` protocol requirement on `SerialExecutor`:
5858

5959
```swift
6060
protocol SerialExecutor: Executor {
@@ -73,11 +73,11 @@ protocol SerialExecutor: Executor {
7373
/// a job itself.
7474
///
7575
/// A default implementation is provided that unconditionally causes a fatal error.
76-
func checkIsolation()
76+
func checkIsolated()
7777
}
7878

7979
extension SerialExecutor {
80-
public func checkIsolation() {
80+
public func checkIsolated() {
8181
fatalError("Incorrect actor executor assumption, expected: \(self)")
8282
}
8383
}
@@ -170,7 +170,7 @@ Asynchronous functions should not use dynamic isolation checking. Isolation che
170170

171171
### Introduce `globalMainExecutor` global property and utilize `checkIsolated` on it
172172

173-
This proposal also paves the way to clean up this hard-coded aspect of the runtime, and it would be possible to change these heurystics to instead invoke the `checkIsolation()` method on a "main actor executor" SerialExecutor reference if it were available.
173+
This proposal also paves the way to clean up this hard-coded aspect of the runtime, and it would be possible to change these heurystics to instead invoke the `checkIsolated()` method on a "main actor executor" SerialExecutor reference if it were available.
174174

175175
This proposal does not introduce a `globalMainActorExecutor`, however, similar how how [SE-0417: Task ExecutorPreference](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0417-task-executor-preference.md) introduced a:
176176

0 commit comments

Comments
 (0)