Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/swift/Block.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import CDispatch
@_implementationOnly import _DispatchOverlayShims

public struct DispatchWorkItemFlags : OptionSet, RawRepresentable {
public struct DispatchWorkItemFlags : OptionSet, RawRepresentable, Sendable {
public let rawValue: UInt
public init(rawValue: UInt) { self.rawValue = rawValue }

Expand Down
8 changes: 4 additions & 4 deletions src/swift/Data.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
import CDispatch
@_implementationOnly import _DispatchOverlayShims

public struct DispatchData : RandomAccessCollection {
public struct DispatchData : RandomAccessCollection, Sendable {
public typealias Iterator = DispatchDataIterator
public typealias Index = Int
public typealias Indices = DefaultIndices<DispatchData>

public static let empty: DispatchData = DispatchData(data: _swift_dispatch_data_empty())

public enum Deallocator {
public enum Deallocator : Sendable {
/// Use `free`
case free

Expand All @@ -34,7 +34,7 @@ public struct DispatchData : RandomAccessCollection {
// However, adding the annotation here results in Data.o containing
// a reference to _TMBO (opaque metadata for Builtin.UnknownObject)
// which is only made available on platforms with Objective-C.
case custom(DispatchQueue?, () -> Void)
@preconcurrency case custom(DispatchQueue?, () -> Void)

fileprivate var _deallocator: (DispatchQueue?, @convention(block) () -> Void) {
switch self {
Expand Down Expand Up @@ -329,7 +329,7 @@ public struct DispatchData : RandomAccessCollection {
}
}

public struct DispatchDataIterator : IteratorProtocol, Sequence {
public struct DispatchDataIterator : IteratorProtocol, Sequence, @unchecked Sendable {
public typealias Element = UInt8

/// Create an iterator over the given DispatchData
Expand Down
6 changes: 3 additions & 3 deletions src/swift/IO.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ import WinSDK

extension DispatchIO {

public enum StreamType : UInt {
public enum StreamType : UInt, Sendable {
case stream = 0
case random = 1
}

public struct CloseFlags : OptionSet, RawRepresentable {
public struct CloseFlags : OptionSet, RawRepresentable, Sendable {
public let rawValue: UInt
public init(rawValue: UInt) { self.rawValue = rawValue }

public static let stop = CloseFlags(rawValue: 1)
}

public struct IntervalFlags : OptionSet, RawRepresentable {
public struct IntervalFlags : OptionSet, RawRepresentable, Sendable {
public let rawValue: UInt
public init(rawValue: UInt) { self.rawValue = rawValue }
public init(nilLiteral: ()) { self.rawValue = 0 }
Expand Down
6 changes: 3 additions & 3 deletions src/swift/Queue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ internal class _DispatchSpecificValue<T> {
}

extension DispatchQueue {
public struct Attributes : OptionSet {
public struct Attributes : OptionSet, Sendable {
public let rawValue: UInt64
public init(rawValue: UInt64) { self.rawValue = rawValue }

Expand All @@ -52,7 +52,7 @@ extension DispatchQueue {
}
}

public enum GlobalQueuePriority {
public enum GlobalQueuePriority : Sendable {
@available(macOS, deprecated: 10.10, message: "Use qos attributes instead")
@available(iOS, deprecated: 8.0, message: "Use qos attributes instead")
@available(tvOS, deprecated, message: "Use qos attributes instead")
Expand Down Expand Up @@ -87,7 +87,7 @@ extension DispatchQueue {
}
}

public enum AutoreleaseFrequency {
public enum AutoreleaseFrequency : Sendable {
case inherit

@available(macOS 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *)
Expand Down