Skip to content

Commit 2df0f76

Browse files
committed
queue.async/asyncAfter closures are @sendable
1 parent 6495db7 commit 2df0f76

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/swift/Queue.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ extension DispatchQueue {
253253
group: DispatchGroup? = nil,
254254
qos: DispatchQoS = .unspecified,
255255
flags: DispatchWorkItemFlags = [],
256-
execute work: @escaping @convention(block) () -> Void)
256+
execute work: @escaping @Sendable @convention(block) () -> Void)
257257
{
258258
if group == nil && qos == .unspecified {
259259
// Fast-path route for the most common API usage
@@ -387,7 +387,7 @@ extension DispatchQueue {
387387
deadline: DispatchTime,
388388
qos: DispatchQoS = .unspecified,
389389
flags: DispatchWorkItemFlags = [],
390-
execute work: @escaping @convention(block) () -> Void)
390+
execute work: @escaping @Sendable @convention(block) () -> Void)
391391
{
392392
if #available(macOS 10.10, iOS 8.0, *), qos != .unspecified || !flags.isEmpty {
393393
let item = DispatchWorkItem(qos: qos, flags: flags, block: work)
@@ -418,7 +418,7 @@ extension DispatchQueue {
418418
wallDeadline: DispatchWallTime,
419419
qos: DispatchQoS = .unspecified,
420420
flags: DispatchWorkItemFlags = [],
421-
execute work: @escaping @convention(block) () -> Void)
421+
execute work: @escaping @Sendable @convention(block) () -> Void)
422422
{
423423
if #available(macOS 10.10, iOS 8.0, *), qos != .unspecified || !flags.isEmpty {
424424
let item = DispatchWorkItem(qos: qos, flags: flags, block: work)

0 commit comments

Comments
 (0)