Skip to content

Add Sendable conformance to DispatchWorkItemsFlags and DispatchQueue #910

@alephao

Description

@alephao

Similar to #779, #787, #845 and #847.

  • DispatchWorkItemsFlags has no mutable state
  • I guess DispatchQueue is Sendable on iOS, so maybe it could be Sendable on Linux too?

This error is triggered when building GRDB

------
302.2 25 |     private let flags: DispatchWorkItemFlags
302.2    |                 `- error: stored property 'flags' of 'Sendable'-conforming class 'DispatchQueueExecutor' has non-sendable type 'DispatchWorkItemFlags'
302.2 26 |     
302.2 27 |     init(queue: DispatchQueue, flags: DispatchWorkItemFlags) {
302.2 
302.2 Dispatch.DispatchWorkItemFlags:1:15: note: struct 'DispatchWorkItemFlags' does not conform to the 'Sendable' protocol
302.2  1 | public struct DispatchWorkItemFlags : OptionSet, RawRepresentable {
302.2    |               `- note: struct 'DispatchWorkItemFlags' does not conform to the 'Sendable' protocol
302.2  2 |     public let rawValue: UInt
302.2  3 |     public init(rawValue: UInt)
------

Environment

Swift version 6.2 (swift-6.2-RELEASE)
Target: aarch64-unknown-linux-gnu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions