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

NSLock does not conform to Sendable on Linux #4941

Closed
maartene opened this issue Apr 29, 2024 · 0 comments · Fixed by #4944
Closed

NSLock does not conform to Sendable on Linux #4941

maartene opened this issue Apr 29, 2024 · 0 comments · Fixed by #4944
Assignees

Comments

@maartene
Copy link
Contributor

As per the documentation NSLock should conform to Sendable. And indeed, when compiling my code with strict concurrency checking on macOS, no warnings are issued.

However, when compiling on Linux, I get the warning:

warning: static property 'lock' is not concurrency-safe because it is not either conforming to 'Sendable' or isolated to a global actor; this is an error in Swift 6
    static private let lock = NSLock()

From discussion on the Swift forum, I conclude that this is unintended and NSLock on Linux too should conform to Sendable.

Perhaps this can be fixed?

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

Successfully merging a pull request may close this issue.

1 participant