Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Sendable conformances to thread-safe types #779

Open
fumoboy007 opened this issue Feb 9, 2023 · 1 comment
Open

Add Sendable conformances to thread-safe types #779

fumoboy007 opened this issue Feb 9, 2023 · 1 comment

Comments

@fumoboy007
Copy link

All or almost all of Dispatch’s types are thread-safe, so they should be marked as Sendable.

@mman
Copy link

mman commented Apr 24, 2024

There is this weird state in Swift 5.10 where on Linux usage of Dispatch with StrictConcurrencyChecking enabled generates these nonsensical errors that do not exist on macOS.

For example:

main.swift:131:31: warning: passing argument of non-sendable type 'DispatchQueue' outside of main actor-isolated context may introduce data races
        try await host.start(queue: queue)
                              ^
Dispatch.DispatchQueue:1:14: note: class 'DispatchQueue' does not conform to the 'Sendable' protocol
public class DispatchQueue : DispatchObject {
             ^
main.swift:2:1: remark: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'Dispatch'
import Dispatch
^

This needs fixing...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants