Skip to content

Commit

Permalink
Merge pull request #40616 from DougGregor/concurrency-sendable-frozen…
Browse files Browse the repository at this point in the history
…-types
  • Loading branch information
DougGregor committed Dec 18, 2021
2 parents 21e13c4 + 400404c commit c4e8844
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stdlib/public/Concurrency/Executor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public protocol SerialExecutor: Executor {
/// actor.
@available(SwiftStdlib 5.1, *)
@frozen
public struct UnownedSerialExecutor {
public struct UnownedSerialExecutor: Sendable {
#if compiler(>=5.5) && $BuiltinExecutor
@usableFromInline
internal var executor: Builtin.Executor
Expand Down
4 changes: 4 additions & 0 deletions stdlib/public/Concurrency/Task.swift
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,10 @@ public struct UnsafeCurrentTask {
}
}

@available(SwiftStdlib 5.1, *)
@available(*, unavailable)
extension UnsafeCurrentTask: Sendable { }

@available(SwiftStdlib 5.1, *)
extension UnsafeCurrentTask: Hashable {
public func hash(into hasher: inout Hasher) {
Expand Down
8 changes: 8 additions & 0 deletions stdlib/public/Concurrency/TaskGroup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,10 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
}
}

@available(SwiftStdlib 5.1, *)
@available(*, unavailable)
extension TaskGroup: Sendable { }

// Implementation note:
// We are unable to just™ abstract over Failure == Error / Never because of the
// complicated relationship between `group.spawn` which dictates if `group.next`
Expand Down Expand Up @@ -694,6 +698,10 @@ public struct ThrowingTaskGroup<ChildTaskResult: Sendable, Failure: Error> {
}
}

@available(SwiftStdlib 5.1, *)
@available(*, unavailable)
extension ThrowingTaskGroup: Sendable { }

/// ==== TaskGroup: AsyncSequence ----------------------------------------------

@available(SwiftStdlib 5.1, *)
Expand Down

0 comments on commit c4e8844

Please sign in to comment.