Add comments clarifying thread-safety (#282)

This commit is contained in:
Dmitry Kovba
2025-09-08 23:15:22 -07:00
committed by GitHub
parent 9aa552593b
commit 1b1cfdbaf3
6 changed files with 8 additions and 5 deletions
@@ -45,6 +45,7 @@ public struct ContainerManager: Sendable {
@available(macOS 26.0, *)
public struct VmnetNetwork: Network {
private var allocator: Allocator
// `reference` isn't used concurrently.
nonisolated(unsafe) private let reference: vmnet_network_ref
/// The IPv4 subnet of this network.
@@ -94,6 +95,7 @@ public struct ContainerManager: Sendable {
public let gateway: String?
public let macAddress: String?
// `reference` isn't used concurrently.
nonisolated(unsafe) private let reference: vmnet_network_ref
public init(
@@ -478,9 +480,4 @@ extension CIDRAddress {
}
}
@available(macOS 26.0, *)
private struct SendableReference: Sendable {
nonisolated(unsafe) private let reference: vmnet_network_ref
}
#endif