Skip to content

Commit 1368bda

Browse files
committed
Remove an unnecessary extension of NSLock
1 parent 528a4a3 commit 1368bda

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

Sources/Services/ContainerNetworkService/ReservedVmnetNetwork.swift

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public final class ReservedVmnetNetwork: Network {
6060
}
6161

6262
public nonisolated func withAdditionalData(_ handler: (XPCMessage?) throws -> Void) throws {
63-
try networkLock.lock {
63+
try networkLock.withLock {
6464
try handler(network.map { try Self.serialize_network_ref(ref: $0) })
6565
}
6666
}
@@ -148,13 +148,3 @@ public final class ReservedVmnetNetwork: Network {
148148
)
149149
}
150150
}
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

Comments
 (0)