Skip to content

Commit 2ee9b16

Browse files
authored
Merge pull request #85126 from amartini51/task_cancellation_162979796
Document withTaskCancellationHandler parameters and at-most-once semantics Fixes: rdar://162979796
2 parents 74ea47a + 09bbcdd commit 2ee9b16

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

stdlib/public/Concurrency/TaskCancellation.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ import Swift
1717
/// Execute an operation with a cancellation handler that's immediately
1818
/// invoked if the current task is canceled.
1919
///
20+
/// - Parameters:
21+
/// - operation: The operation to perform.
22+
/// - handler: A closure to execute on cancellation.
23+
/// If the task is canceled, this closure is called at most once;
24+
/// otherwise, it isn't called.
25+
/// - isolation: The actor that the operation and cancellation handler are isolated to.
26+
///
2027
/// This differs from the operation cooperatively checking for cancellation
2128
/// and reacting to it in that the cancellation handler is _always_ and
2229
/// _immediately_ invoked when the task is canceled. For example, even if the

0 commit comments

Comments
 (0)