We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
NSLock
1 parent 528a4a3 commit 1368bdaCopy full SHA for 1368bda
Sources/Services/ContainerNetworkService/ReservedVmnetNetwork.swift
@@ -60,7 +60,7 @@ public final class ReservedVmnetNetwork: Network {
60
}
61
62
public nonisolated func withAdditionalData(_ handler: (XPCMessage?) throws -> Void) throws {
63
- try networkLock.lock {
+ try networkLock.withLock {
64
try handler(network.map { try Self.serialize_network_ref(ref: $0) })
65
66
@@ -148,13 +148,3 @@ public final class ReservedVmnetNetwork: Network {
148
)
149
150
151
-
152
-extension NSLock {
153
- /// lock during the execution of the provided function
154
- fileprivate func lock<T>(_ fn: () throws -> T) rethrows -> T {
155
- self.lock()
156
- defer { self.unlock() }
157
158
- return try fn()
159
- }
160
-}
0 commit comments