swiftlang / swiftlang/swift-corelibs-libdispatch
Add `Sendable` conformance to `DispatchWorkItemsFlags` and `DispatchQueue`
Open
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 2.6k
- Forks
- 496
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 3
Description
Similar to #779, #787, #845 and #847.
DispatchWorkItemsFlagshas no mutable state- I guess
DispatchQueueisSendableon iOS, so maybe it could beSendableon 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the Swift declarations for DispatchWorkItemsFlags and DispatchQueue, then reproduce the Swift 6.2 Linux build error shown in the issue. Check the existing Dispatch API declarations and related Sendable changes referenced by issues #779, #787, #845, and #847; done means the affected GRDB build no longer reports these non-Sendable types.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- operating-systems
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100