1515// symbols that are not provided by this library - so instead it has to re-implement
1616// all of this on its own...
1717
18- #if canImport(Darwin)
19- import Darwin
18+ #if canImport(Darwin.os.lock )
19+ import Darwin. os . lock
2020#elseif canImport(Glibc)
2121import Glibc
2222#elseif canImport(Musl)
@@ -31,7 +31,7 @@ import Bionic
3131#endif
3232
3333internal struct Lock {
34- #if canImport(Darwin)
34+ #if canImport(Darwin.os.lock )
3535 typealias Primitive = os_unfair_lock
3636 #elseif canImport(Glibc) || canImport(Musl) || canImport(Bionic)
3737 #if os(FreeBSD) || os(OpenBSD)
@@ -59,7 +59,7 @@ internal struct Lock {
5959 }
6060
6161 fileprivate static func initialize( _ platformLock: PlatformLock ) {
62- #if canImport(Darwin)
62+ #if canImport(Darwin.os.lock )
6363 platformLock. initialize ( to: os_unfair_lock ( ) )
6464 #elseif canImport(Glibc) || canImport(Musl) || canImport(Bionic)
6565 let result = pthread_mutex_init ( platformLock, nil )
@@ -82,7 +82,7 @@ internal struct Lock {
8282 }
8383
8484 fileprivate static func lock( _ platformLock: PlatformLock ) {
85- #if canImport(Darwin)
85+ #if canImport(Darwin.os.lock )
8686 os_unfair_lock_lock ( platformLock)
8787 #elseif canImport(Glibc) || canImport(Musl) || canImport(Bionic)
8888 pthread_mutex_lock ( platformLock)
@@ -95,7 +95,7 @@ internal struct Lock {
9595 }
9696
9797 fileprivate static func unlock( _ platformLock: PlatformLock ) {
98- #if canImport(Darwin)
98+ #if canImport(Darwin.os.lock )
9999 os_unfair_lock_unlock ( platformLock)
100100 #elseif canImport(Glibc) || canImport(Musl) || canImport(Bionic)
101101 let result = pthread_mutex_unlock ( platformLock)
0 commit comments