@@ -44,7 +44,10 @@ public func withTaskCancellationHandler<T>(
44
44
45
45
@available ( SwiftStdlib 5 . 5 , * )
46
46
extension Task {
47
- /// Returns `true` if the task is cancelled, and should stop executing.
47
+ /// A Boolean value that indicates whether the task should stop executing.
48
+ ///
49
+ /// After the value of this property becomes `true`, it remains `true` indefinitely.
50
+ /// There is no way to uncancel a task.
48
51
///
49
52
/// - SeeAlso: `checkCancellation()`
50
53
public var isCancelled : Bool {
@@ -60,10 +63,10 @@ extension Task {
60
63
61
64
@available ( SwiftStdlib 5 . 5 , * )
62
65
extension Task where Success == Never , Failure == Never {
63
- /// Returns `true` if the task is cancelled, and should stop executing.
66
+ /// A Boolean value that indicates whether the task should stop executing.
64
67
///
65
- /// If no current `Task` is available, returns `false `, as outside of a task
66
- /// context no task cancellation may be observed .
68
+ /// After the value of this property becomes `true `, it remains `true` indefinitely.
69
+ /// There is no way to uncancel a task .
67
70
///
68
71
/// - SeeAlso: `checkCancellation()`
69
72
public static var isCancelled : Bool {
@@ -75,7 +78,7 @@ extension Task where Success == Never, Failure == Never {
75
78
76
79
@available ( SwiftStdlib 5 . 5 , * )
77
80
extension Task where Success == Never , Failure == Never {
78
- /// Check if the task is cancelled and throw an `CancellationError` if it was.
81
+ /// Throws an error if the task was canceled .
79
82
///
80
83
/// The error is always an instance of `Task.CancellationError`.
81
84
///
@@ -87,10 +90,10 @@ extension Task where Success == Never, Failure == Never {
87
90
}
88
91
}
89
92
90
- /// The default cancellation thrown when a task is cancelled .
93
+ /// An error that indicates a task was canceled .
91
94
///
92
95
/// This error is also thrown automatically by `Task.checkCancellation()`,
93
- /// if the current task has been cancelled .
96
+ /// if the current task has been canceled .
94
97
@available ( SwiftStdlib 5 . 5 , * )
95
98
public struct CancellationError : Error {
96
99
// no extra information, cancellation is intended to be light-weight
0 commit comments