From d24bca48a29a3ef0a26312d0330be1524def82a6 Mon Sep 17 00:00:00 2001 From: dimitris-c Date: Thu, 11 Jul 2024 14:24:20 +0300 Subject: [PATCH] Add usage of OSAllocatedUnfairLock for macOS 13+ --- AudioStreaming/Core/Helpers/Lock.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AudioStreaming/Core/Helpers/Lock.swift b/AudioStreaming/Core/Helpers/Lock.swift index 8d3140d..3aff60d 100644 --- a/AudioStreaming/Core/Helpers/Lock.swift +++ b/AudioStreaming/Core/Helpers/Lock.swift @@ -26,7 +26,7 @@ final class UnfairLock: Lock { var unfairLock: Lock init() { - if #available(iOS 16.0, *) { + if #available(iOS 16.0, *), #available(macOS 13.0, *) { unfairLock = OSStorageLock() } else { unfairLock = UnfairStorageLock() @@ -67,6 +67,7 @@ final class UnfairLock: Lock { } @available(iOS 16.0, *) +@available(macOS 13, *) private class OSStorageLock: Lock { @usableFromInline let osLock = OSAllocatedUnfairLock()