Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions stdlib/public/Concurrency/DiscardingTaskGroup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import Swift
/// before returning from this function:
///
/// ```
/// await withDiscardingTaskGroup { group in
/// await withDiscardingTaskGroup(...) { group in
/// group.addTask { /* slow-task */ }
/// // slow-task executes...
/// }
Expand Down Expand Up @@ -357,7 +357,7 @@ extension DiscardingTaskGroup: Sendable { }
/// before returning from this function:
///
/// ```
/// try await withThrowingDiscardingTaskGroup { group in
/// try await withThrowingDiscardingTaskGroup(of: Void.self) { group in
/// group.addTask { /* slow-task */ }
/// // slow-task executes...
/// }
Expand Down Expand Up @@ -390,7 +390,7 @@ extension DiscardingTaskGroup: Sendable { }
///
/// ```
/// // ThrowingTaskGroup, pattern not applicable to ThrowingDiscardingTaskGroup
/// try await withThrowingTaskGroup { group in
/// try await withThrowingTaskGroup(of: Void.self) { group in
/// group.addTask { try boom() }
/// try await group.next() // re-throws "boom"
/// }
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/Concurrency/TaskGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ using FutureFragment = AsyncTask::FutureFragment;

/// During evolution discussions we opted to implement the following semantic of
/// a discarding task-group throw:
/// - the error thrown out of withThrowingDiscardingTaskGroup { ... } always "wins",
/// - the error thrown out of withThrowingDiscardingTaskGroup(...) { ... } always "wins",
/// even if the group already had an error stored within.
///
/// This is harder to implement, since we have to always store the "first error from children",
Expand Down