Skip to content

Commit d45d56b

Browse files
ktosoamartini51
andauthored
Update stdlib/public/Concurrency/Task.swift
Co-authored-by: Alex Martini <[email protected]>
1 parent 11b6bd0 commit d45d56b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

stdlib/public/Concurrency/Task.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,10 @@ import Swift
8383
/// Once this code has ran to completion, and the task therefore has completed, resulting in either
8484
/// a failure or result value, this closure is eagerly released.
8585
///
86-
/// Keeping the `Task` object retained, will not indefinitely keep the closure retained.
87-
/// This means that tasks rarely need to capture values as `weak`, since when they complete
88-
/// any references they hold are released (as the closure is released).
86+
/// Retaining a task object doesn't indefinitely retain the closure,
87+
/// because any references that a task holds are released
88+
/// after the task completes.
89+
/// Consequently, tasks rarely need to capture weak references to values.
8990
///
9091
/// For example, in this example, it is not necessary to capture the actor as weak,
9192
/// because as the task completes it'll let go of the actor reference, breaking the

0 commit comments

Comments
 (0)