Skip to content

Commit 24b8954

Browse files
authored
[SE-0462] Add a few missing "of:" in code examples (#2704)
1 parent 1dc6904 commit 24b8954

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

proposals/0462-task-priority-escalation-apis.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ await withTaskPriorityEscalationHandler {
9393
}
9494
// priority was escalated just before we stored the task in the mutex
9595
if let newPriority {
96-
Task.escalatePriority(task, to: newPriority)
96+
Task.escalatePriority(of: task, to: newPriority)
9797
}
9898
} onPriorityEscalated: { newPriority in
9999
state.withLock { state in
@@ -102,7 +102,7 @@ await withTaskPriorityEscalationHandler {
102102
// priority was escalated just before we managed to store the task in the mutex
103103
state = .priority(newPriority)
104104
case .task(let task):
105-
Task.escalatePriority(task, to: newPriority)
105+
Task.escalatePriority(of: task, to: newPriority)
106106
}
107107
}
108108
}
@@ -172,7 +172,7 @@ The API can also be freely composed with `withTaskCancellationHandler` or there
172172

173173
While generally developers should not rely on manual task escalation handling, this API also does introduce a manual way to escalate a task's priority. Primarily this should be used in combination with a task escalation handler to _propagate_ an escalation to an _unstructured task_ which otherwise would miss reacting to the escalation.
174174

175-
The `escalatePriority` API is offered as a static method on `Task` in order to slightly hide it away from using it accidentally by stumbling upon it if it were directly declared as a member method of a Task.
175+
The `escalatePriority(of:to:)` API is offered as a static method on `Task` in order to slightly hide it away from using it accidentally by stumbling upon it if it were directly declared as a member method of a Task.
176176

177177
```swift
178178
extension Task {
@@ -224,7 +224,7 @@ await withCheckedContinuation2 { cc in
224224
cc.resume(throwing: CancellationError())
225225
} onPriorityEscalated: { cc, newPriority in
226226
print("new priority: \(newPriority)")
227-
C.withLock { Task.escalatePriority($0.task, to: newPriority) }
227+
C.withLock { Task.escalatePriority(of: $0.task, to: newPriority) }
228228
}
229229
```
230230

@@ -234,4 +234,4 @@ Overall, this seems like a tightly knit API that changes current idioms of `with
234234

235235
### Acknowledgements
236236

237-
We'd like to thank John McCall, David Nadoba for their input on the APIs during early reviews.
237+
I'd like to thank John McCall, David Nadoba for their input on the APIs during early reviews.

0 commit comments

Comments
 (0)