You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I agree. If using new new Mutex most types don't even have to use @unchecked Sendable since Mutex is unconditionally Sendable. @unchecked Sendable is required with atomics though.
We have developed some patterns to limit the "just sprinkle @unchecked Sendable on it" on codebases.
We should showcase some of our recent locks:
Maybe we should take the chance to show good lock patterns here.
Like for example https://github.com/apple/swift-nio/blob/main/Sources/NIOConcurrencyHelpers/NIOLockedValueBox.swift
which is just:
Or also the new
Mutex
type -- we can ask https://github.com/swiftlang/swift-evolution/blob/main/proposals/0433-mutex.md @Azoy to provide a small snippetThe text was updated successfully, but these errors were encountered: