swiftlang / swiftlang/swift-corelibs-libdispatch

class DispatchSerialQueue not available under Linux

Open
#848 1 comment 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

Probably another inconsistency, but the following code creating an actor backed by serial DispatchQueue works on macOS and does not compile under Linux:

public actor MyActor {
    let queue = DispatchSerialQueue(label: "actorQueue")

    nonisolated public var unownedExecutor: UnownedSerialExecutor {
        queue.asUnownedSerialExecutor()
    }
}

Under Linux it produces the following error:

/src/Sources/Test/test.swift:63:17: error: cannot find 'DispatchSerialQueue' in scope
 61 | public actor MyActor {
 62 |     let logger: Logger
 63 |     let queue = DispatchSerialQueue(label: "relayQueue")
    |                 `- error: cannot find 'DispatchSerialQueue' in scope
 64 | 
 65 |     nonisolated public var unownedExecutor: UnownedSerialExecutor {

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 by reproducing the provided actor and DispatchSerialQueue snippet on Linux, then compare its availability with macOS. The issue is resolved when the example compiles under Linux with the expected serial-executor behavior; no source file or test is named in the report.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.