swiftlang / swiftlang/swift-corelibs-libdispatch

bug: `DispatchSpecificKey` missing conditional `Sendable` annotation

Open
#845 0 comments 0 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

On macOS, DispatchSpecificKey is defined like this:

final public class DispatchSpecificKey<T> {

    public init()
}

extension DispatchSpecificKey : Sendable where T : Sendable {
}

on Linux the conditional conformance to Sendable is missing.

https://github.com/apple/swift-corelibs-libdispatch/blob/e85f6a0d5c9ea1f32f5013c3fa34e4fc146cd0eb/src/swift/Queue.swift#L18

The end result is that code with strict concurrency checking that does compile under macOS with Swift 6 does not compile under Linux.

See the associated post here: https://forums.swift.org/t/dispatchqueue-setspecific-swift-6-concurrency-linux/74653

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

Start in src/swift/Queue.swift at the DispatchSpecificKey definition linked in the issue, and compare it with the macOS declaration shown in the report. Verify the Linux behavior with strict concurrency checking; done means Linux accepts the same conditional Sendable conformance as macOS.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
operating-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.