Skip to content

Commit 3723c2f

Browse files
committed
Adopt Sendable in the Task APIs
1 parent e5f6740 commit 3723c2f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

stdlib/public/Concurrency/Task.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import Swift
3737
/// with by end-users directly, unless implementing a scheduler.
3838
@available(SwiftStdlib 5.5, *)
3939
@frozen
40-
public struct Task<Success, Failure: Error>: Sendable {
40+
public struct Task<Success: Sendable, Failure: Error>: Sendable {
4141
@usableFromInline
4242
internal let _task: Builtin.NativeObject
4343

stdlib/public/Concurrency/TaskGroup.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public func withThrowingTaskGroup<ChildTaskResult, GroupResult>(
179179
/// It is created by the `withTaskGroup` function.
180180
@available(SwiftStdlib 5.5, *)
181181
@frozen
182-
public struct TaskGroup<ChildTaskResult> {
182+
public struct TaskGroup<ChildTaskResult: Sendable> {
183183

184184
/// Group task into which child tasks offer their results,
185185
/// and the `next()` function polls those results from.
@@ -406,7 +406,7 @@ public struct TaskGroup<ChildTaskResult> {
406406
/// It is created by the `withTaskGroup` function.
407407
@available(SwiftStdlib 5.5, *)
408408
@frozen
409-
public struct ThrowingTaskGroup<ChildTaskResult, Failure: Error> {
409+
public struct ThrowingTaskGroup<ChildTaskResult: Sendable, Failure: Error> {
410410

411411
/// Group task into which child tasks offer their results,
412412
/// and the `next()` function polls those results from.

0 commit comments

Comments
 (0)