@@ -26,13 +26,14 @@ import Swift
26
26
/// It's not a programming error to discard a reference to a task
27
27
/// without waiting for that task to finish or canceling it.
28
28
/// A task runs whether or not you keep a reference to it.
29
- /// However, if you discard a task's handle, you give up the ability
29
+ /// However, if you discard the reference to a task,
30
+ /// you give up the ability
30
31
/// to wait for that task's result or cancel the task.
31
32
///
32
33
/// To support operations on the current task,
33
34
/// which can be either a detached task or a child task,
34
- /// `Task` also exposes class methods like `yield()` and `currentPriority` .
35
- /// Because all such functions are asynchronous,
35
+ /// `Task` also exposes class methods like `yield()`.
36
+ /// Because these methods are asynchronous,
36
37
/// they're always invoked as part of an existing task.
37
38
///
38
39
/// Only code that's running as part of the task can interact with that task,
@@ -92,13 +93,13 @@ public struct Task<Success, Failure: Error>: Sendable {
92
93
extension Task {
93
94
/// Wait for the task to complete, returning its result or throwing an error.
94
95
///
95
- /// If the task hasn't completed,
96
+ /// If the task hasn't completed yet ,
96
97
/// its priority increases to that of the current task.
97
98
/// Note that this might not be as effective as
98
99
/// creating the task with the correct priority,
99
100
/// depending on the executor's scheduling details.
100
101
///
101
- /// If the task throws an error, this method propogates that error.
102
+ /// If the task throws an error, this property propogates that error.
102
103
/// Tasks that respond to cancellation by throwing `Task.CancellationError`
103
104
/// have that error propogated here upon cancellation.
104
105
///
@@ -111,7 +112,7 @@ extension Task {
111
112
112
113
/// Wait for the task to complete, returning its result or its error.
113
114
///
114
- /// If the task hasn't completed, its priority increases to the
115
+ /// If the task hasn't completed yet , its priority increases to the
115
116
/// priority of the current task. Note that this isn't as effective as
116
117
/// creating the task with the correct priority.
117
118
///
@@ -150,15 +151,14 @@ extension Task {
150
151
extension Task where Failure == Never {
151
152
/// Wait for the task to complete, returning its result.
152
153
///
153
- /// If the task hasn't completed,
154
+ /// If the task hasn't completed yet ,
154
155
/// its priority increases to that of the current task.
155
156
/// Note that this might not be as effective as
156
157
/// creating the task with the correct priority,
157
158
/// depending on the executor's scheduling details.
158
159
///
159
- /// Because this method is nonthrowing,
160
- /// if the task checks for cancellation,
161
- /// it needs to handle cancellation using an approach like returning `nil`
160
+ /// Tasks that never throw an error can still check for cancellation,
161
+ /// but they need to use an approach like returning `nil`
162
162
/// instead of throwing an error.
163
163
public var value : Success {
164
164
get async {
@@ -458,7 +458,7 @@ extension Task where Failure == Never {
458
458
/// so the operation is treated more like an asynchronous extension
459
459
/// to the synchronous operation.
460
460
///
461
- /// You need to keep a reference to the detached task
461
+ /// You need to keep a reference to the task
462
462
/// if you want to cancel it by calling the `Task.cancel()` method.
463
463
/// Discarding your reference to a detached task
464
464
/// doesn't implicitly cancel that task,
@@ -506,7 +506,7 @@ extension Task where Failure == Error {
506
506
/// so the operation is treated more like an asynchronous extension
507
507
/// to the synchronous operation.
508
508
///
509
- /// You need to keep a reference to the detached task
509
+ /// You need to keep a reference to the task
510
510
/// if you want to cancel it by calling the `Task.cancel()` method.
511
511
/// Discarding your reference to a detached task
512
512
/// doesn't implicitly cancel that task,
@@ -747,7 +747,7 @@ public struct UnsafeCurrentTask {
747
747
/// A Boolean value that indicates whether the current task was canceled.
748
748
///
749
749
/// After the value of this property is `true`, it remains `true` indefinitely.
750
- /// There is no way to uncancel the operation .
750
+ /// There is no way to uncancel a task .
751
751
///
752
752
/// - SeeAlso: `checkCancellation()`
753
753
public var isCancelled : Bool {
0 commit comments