Skip to content

Commit

Permalink
queue.async/asyncAfter closures are @sendable
Browse files Browse the repository at this point in the history
  • Loading branch information
ktoso committed Mar 29, 2024
1 parent 6495db7 commit 2df0f76
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/swift/Queue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ extension DispatchQueue {
group: DispatchGroup? = nil,
qos: DispatchQoS = .unspecified,
flags: DispatchWorkItemFlags = [],
execute work: @escaping @convention(block) () -> Void)
execute work: @escaping @Sendable @convention(block) () -> Void)
{
if group == nil && qos == .unspecified {
// Fast-path route for the most common API usage
Expand Down Expand Up @@ -387,7 +387,7 @@ extension DispatchQueue {
deadline: DispatchTime,
qos: DispatchQoS = .unspecified,
flags: DispatchWorkItemFlags = [],
execute work: @escaping @convention(block) () -> Void)
execute work: @escaping @Sendable @convention(block) () -> Void)
{
if #available(macOS 10.10, iOS 8.0, *), qos != .unspecified || !flags.isEmpty {
let item = DispatchWorkItem(qos: qos, flags: flags, block: work)
Expand Down Expand Up @@ -418,7 +418,7 @@ extension DispatchQueue {
wallDeadline: DispatchWallTime,
qos: DispatchQoS = .unspecified,
flags: DispatchWorkItemFlags = [],
execute work: @escaping @convention(block) () -> Void)
execute work: @escaping @Sendable @convention(block) () -> Void)
{
if #available(macOS 10.10, iOS 8.0, *), qos != .unspecified || !flags.isEmpty {
let item = DispatchWorkItem(qos: qos, flags: flags, block: work)
Expand Down

0 comments on commit 2df0f76

Please sign in to comment.