swiftlang / swiftlang/swift-corelibs-libdispatch

Add `Sendable` conformance to `DispatchWorkItemsFlags` and `DispatchQueue`

Open
#910 0 comments 2 reactions 0 assignees View on GitHub

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.

  • 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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.