Skip to content

Commit

Permalink
Add inline comment note about OSAllocatedUnfairLock (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
rebello95 authored Oct 15, 2023
1 parent 7420750 commit fab0c2e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Libraries/Connect/Implementation/Lock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ final class Lock: Sendable {

init() {
// Reasoning for allocating here: http://www.russbishop.net/the-law
// When iOS 15 support is dropped, `OSAllocatedUnfairLock` should be used.
self.underlyingLock = .allocate(capacity: 1)
self.underlyingLock.initialize(to: os_unfair_lock())
}
Expand Down

0 comments on commit fab0c2e

Please sign in to comment.