From 44ecc6325fec06193d50d51adf02328abee393f7 Mon Sep 17 00:00:00 2001 From: Alex Martini Date: Wed, 18 Sep 2024 15:42:14 -0700 Subject: [PATCH] Revise for documentation style - Use the spelling "canceled" per Apple Style Guide - Use code voice for symbol name - Use contractions - Avoid parenthesis for asides - Change "it" to "that function" to reduce ambiguity --- stdlib/public/Concurrency/Task.swift | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/stdlib/public/Concurrency/Task.swift b/stdlib/public/Concurrency/Task.swift index d97c6b26f6b7c..dab0ded0d06fb 100644 --- a/stdlib/public/Concurrency/Task.swift +++ b/stdlib/public/Concurrency/Task.swift @@ -198,10 +198,10 @@ extension Task { /// /// Cancelling a task has three primary effects: /// - /// - It flags the task as cancelled. - /// - It causes any active cancellation handlers on the task to run (once). + /// - It flags the task as canceled. + /// - It causes any active cancellation handlers on the task to run, once. /// - It cancels any child tasks and task groups of the task, including - /// those created in the future. If those tasks have cancellation handlers, + /// those created in the future. If those tasks have cancellation handlers, /// they also are triggered. /// /// Task cancellation is cooperative and idempotent. @@ -209,21 +209,21 @@ extension Task { /// Cancelling a task does not automatically cause arbitrary functions on the task /// to stop running or throw errors. A function _may_ choose to react /// to cancellation by ending its work early, and it is conventional to - /// signal that to callers by throwing CancellationError. However, + /// signal that to callers by throwing `CancellationError`. However, /// a function that doesn't specifically check for cancellation will - /// run to completion normally even if the task it is running on is - /// cancelled. (Of course, it may still end early if it calls something - /// else that handles cancellation by throwing and then doesn't - /// handle the error.) + /// run to completion normally, even if the task it is running on is + /// canceled. However, that function might still end early if it calls + /// other code that handles cancellation by throwing and that function doesn't + /// handle the error. /// - /// It is safe to cancel a task from any task or thread. It is safe for + /// It's safe to cancel a task from any task or thread. It's safe for /// multiple tasks or threads to cancel the same task at the same - /// time. Cancelling a task that has already been cancelled has no + /// time. Cancelling a task that has already been canceled has no /// additional effect. /// /// `cancel` may need to acquire locks and synchronously run /// arbitrary cancellation-handler code associated with the - /// cancelled task. To reduce the risk of deadlock, it is + /// canceled task. To reduce the risk of deadlock, it is /// recommended that callers release any locks they might be /// holding before they call cancel. ///