Summary
When the SDK's minimum deployment targets are raised to the versions below, replace SentryMutex<T> with Swift's native Synchronization.Mutex:
- iOS 18.0+
- iPadOS 18.0+
- Mac Catalyst 18.0+
- macOS 15.0+
- tvOS 18.0+
- visionOS 2.0+
- watchOS 11.0+
At that point SentryMutex can become a simple typealias SentryMutex = Mutex, removing the custom os_unfair_lock wrapper entirely.
Context
SentryMutex<T> was introduced in #8214 as a backport of Synchronization.Mutex semantics for current deployment targets. The native Mutex uses the same underlying os_unfair_lock primitive on Apple platforms, so the migration should be straightforward.
Deployment target bumps follow the policy of dropping versions when Xcode stops allowing them (see discussion). For reference, Xcode 27 drops macOS 12 (#8113) and watchOS 7 (#8189).
See also the review discussion about runtime exclusivity checks and alternative storage patterns — once we move to Synchronization.Mutex, those concerns go away since the stdlib implementation handles them.
Summary
When the SDK's minimum deployment targets are raised to the versions below, replace
SentryMutex<T>with Swift's nativeSynchronization.Mutex:At that point
SentryMutexcan become a simpletypealias SentryMutex = Mutex, removing the customos_unfair_lockwrapper entirely.Context
SentryMutex<T>was introduced in #8214 as a backport ofSynchronization.Mutexsemantics for current deployment targets. The nativeMutexuses the same underlyingos_unfair_lockprimitive on Apple platforms, so the migration should be straightforward.Deployment target bumps follow the policy of dropping versions when Xcode stops allowing them (see discussion). For reference, Xcode 27 drops macOS 12 (#8113) and watchOS 7 (#8189).
See also the review discussion about runtime exclusivity checks and alternative storage patterns — once we move to
Synchronization.Mutex, those concerns go away since the stdlib implementation handles them.