Skip to content

Commit

Permalink
Add usage of OSAllocatedUnfairLock for macOS 13+
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitris-c committed Jul 11, 2024
1 parent 1916a06 commit d24bca4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion AudioStreaming/Core/Helpers/Lock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -67,6 +67,7 @@ final class UnfairLock: Lock {
}

@available(iOS 16.0, *)
@available(macOS 13, *)
private class OSStorageLock: Lock {
@usableFromInline
let osLock = OSAllocatedUnfairLock()
Expand Down

0 comments on commit d24bca4

Please sign in to comment.