Skip to content

Commit 9962e1b

Browse files
authored
Merge pull request #859 from hborla/dispatchqos-sendable
Add missing `Sendable` conformances to `DispatchPredicate`, `DispatchQoS`, and `DispatchTimeoutResult`.
2 parents 58fc9c5 + e36dbda commit 9962e1b

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/swift/Dispatch.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import CDispatch
1717
/// dispatch_assert
1818

1919
@available(macOS 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *)
20-
public enum DispatchPredicate {
20+
public enum DispatchPredicate : Sendable {
2121
case onQueue(DispatchQueue)
2222
case onQueueAsBarrier(DispatchQueue)
2323
case notOnQueue(DispatchQueue)
@@ -46,7 +46,7 @@ public func dispatchPrecondition(condition: @autoclosure () -> DispatchPredicate
4646

4747
/// qos_class_t
4848

49-
public struct DispatchQoS : Equatable {
49+
public struct DispatchQoS : Equatable, Sendable {
5050
public let qosClass: QoSClass
5151
public let relativePriority: Int
5252

@@ -67,7 +67,7 @@ public struct DispatchQoS : Equatable {
6767

6868
public static let unspecified = DispatchQoS(qosClass: .unspecified, relativePriority: 0)
6969

70-
public enum QoSClass {
70+
public enum QoSClass : Sendable {
7171
@available(macOS 10.10, iOS 8.0, *)
7272
case background
7373

@@ -125,7 +125,7 @@ public func ==(a: DispatchQoS, b: DispatchQoS) -> Bool {
125125

126126
///
127127

128-
public enum DispatchTimeoutResult {
128+
public enum DispatchTimeoutResult : Sendable {
129129
static let KERN_OPERATION_TIMED_OUT:Int = 49
130130
case success
131131
case timedOut

src/swift/Queue.swift

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ public final class DispatchSpecificKey<T> {
1919
public init() {}
2020
}
2121

22+
extension DispatchSpecificKey : Sendable where T : Sendable {
23+
}
24+
2225
internal class _DispatchSpecificValue<T> {
2326
internal let value: T
2427
internal init(value: T) { self.value = value }

0 commit comments

Comments
 (0)