Skip to content

Commit c4e8844

Browse files
authored
Merge pull request #40616 from DougGregor/concurrency-sendable-frozen-types
2 parents 21e13c4 + 400404c commit c4e8844

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

stdlib/public/Concurrency/Executor.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public protocol SerialExecutor: Executor {
4646
/// actor.
4747
@available(SwiftStdlib 5.1, *)
4848
@frozen
49-
public struct UnownedSerialExecutor {
49+
public struct UnownedSerialExecutor: Sendable {
5050
#if compiler(>=5.5) && $BuiltinExecutor
5151
@usableFromInline
5252
internal var executor: Builtin.Executor

stdlib/public/Concurrency/Task.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,10 @@ public struct UnsafeCurrentTask {
762762
}
763763
}
764764

765+
@available(SwiftStdlib 5.1, *)
766+
@available(*, unavailable)
767+
extension UnsafeCurrentTask: Sendable { }
768+
765769
@available(SwiftStdlib 5.1, *)
766770
extension UnsafeCurrentTask: Hashable {
767771
public func hash(into hasher: inout Hasher) {

stdlib/public/Concurrency/TaskGroup.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,10 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
394394
}
395395
}
396396

397+
@available(SwiftStdlib 5.1, *)
398+
@available(*, unavailable)
399+
extension TaskGroup: Sendable { }
400+
397401
// Implementation note:
398402
// We are unable to just™ abstract over Failure == Error / Never because of the
399403
// complicated relationship between `group.spawn` which dictates if `group.next`
@@ -694,6 +698,10 @@ public struct ThrowingTaskGroup<ChildTaskResult: Sendable, Failure: Error> {
694698
}
695699
}
696700

701+
@available(SwiftStdlib 5.1, *)
702+
@available(*, unavailable)
703+
extension ThrowingTaskGroup: Sendable { }
704+
697705
/// ==== TaskGroup: AsyncSequence ----------------------------------------------
698706

699707
@available(SwiftStdlib 5.1, *)

0 commit comments

Comments
 (0)