Skip to content

Commit 946c72c

Browse files
committed
Incorporate tech review corrections.
Feedback from @ktoso.
1 parent e1190a4 commit 946c72c

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

stdlib/public/Concurrency/Task.swift

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@ import Swift
2626
/// It's not a programming error to discard a reference to a task
2727
/// without waiting for that task to finish or canceling it.
2828
/// 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
3031
/// to wait for that task's result or cancel the task.
3132
///
3233
/// To support operations on the current task,
3334
/// 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,
3637
/// they're always invoked as part of an existing task.
3738
///
3839
/// 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 {
9293
extension Task {
9394
/// Wait for the task to complete, returning its result or throwing an error.
9495
///
95-
/// If the task hasn't completed,
96+
/// If the task hasn't completed yet,
9697
/// its priority increases to that of the current task.
9798
/// Note that this might not be as effective as
9899
/// creating the task with the correct priority,
99100
/// depending on the executor's scheduling details.
100101
///
101-
/// If the task throws an error, this method propogates that error.
102+
/// If the task throws an error, this property propogates that error.
102103
/// Tasks that respond to cancellation by throwing `Task.CancellationError`
103104
/// have that error propogated here upon cancellation.
104105
///
@@ -111,7 +112,7 @@ extension Task {
111112

112113
/// Wait for the task to complete, returning its result or its error.
113114
///
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
115116
/// priority of the current task. Note that this isn't as effective as
116117
/// creating the task with the correct priority.
117118
///
@@ -150,15 +151,14 @@ extension Task {
150151
extension Task where Failure == Never {
151152
/// Wait for the task to complete, returning its result.
152153
///
153-
/// If the task hasn't completed,
154+
/// If the task hasn't completed yet,
154155
/// its priority increases to that of the current task.
155156
/// Note that this might not be as effective as
156157
/// creating the task with the correct priority,
157158
/// depending on the executor's scheduling details.
158159
///
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`
162162
/// instead of throwing an error.
163163
public var value: Success {
164164
get async {
@@ -458,7 +458,7 @@ extension Task where Failure == Never {
458458
/// so the operation is treated more like an asynchronous extension
459459
/// to the synchronous operation.
460460
///
461-
/// You need to keep a reference to the detached task
461+
/// You need to keep a reference to the task
462462
/// if you want to cancel it by calling the `Task.cancel()` method.
463463
/// Discarding your reference to a detached task
464464
/// doesn't implicitly cancel that task,
@@ -506,7 +506,7 @@ extension Task where Failure == Error {
506506
/// so the operation is treated more like an asynchronous extension
507507
/// to the synchronous operation.
508508
///
509-
/// You need to keep a reference to the detached task
509+
/// You need to keep a reference to the task
510510
/// if you want to cancel it by calling the `Task.cancel()` method.
511511
/// Discarding your reference to a detached task
512512
/// doesn't implicitly cancel that task,
@@ -747,7 +747,7 @@ public struct UnsafeCurrentTask {
747747
/// A Boolean value that indicates whether the current task was canceled.
748748
///
749749
/// 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.
751751
///
752752
/// - SeeAlso: `checkCancellation()`
753753
public var isCancelled: Bool {

0 commit comments

Comments
 (0)