Skip to content

Commit 0c69e2d

Browse files
committed
Distributed: Add visionOS to Apple platform conditionals.
1 parent 322daab commit 0c69e2d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

stdlib/public/Distributed/LocalTestingDistributedActorSystem.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ public struct LocalTestingDistributedActorSystemError: DistributedActorSystemErr
238238
@available(SwiftStdlib 5.7, *)
239239
@safe
240240
fileprivate class _Lock {
241-
#if os(iOS) || os(macOS) || os(tvOS) || os(watchOS)
241+
#if os(iOS) || os(macOS) || os(tvOS) || os(watchOS) || os(visionOS)
242242
private let underlying: UnsafeMutablePointer<os_unfair_lock>
243243
#elseif os(Windows)
244244
private let underlying: UnsafeMutablePointer<SRWLOCK>
@@ -251,7 +251,7 @@ fileprivate class _Lock {
251251
#endif
252252

253253
init() {
254-
#if os(iOS) || os(macOS) || os(tvOS) || os(watchOS)
254+
#if os(iOS) || os(macOS) || os(tvOS) || os(watchOS) || os(visionOS)
255255
self.underlying = UnsafeMutablePointer.allocate(capacity: 1)
256256
unsafe self.underlying.initialize(to: os_unfair_lock())
257257
#elseif os(Windows)
@@ -268,7 +268,7 @@ fileprivate class _Lock {
268268
}
269269

270270
deinit {
271-
#if os(iOS) || os(macOS) || os(tvOS) || os(watchOS)
271+
#if os(iOS) || os(macOS) || os(tvOS) || os(watchOS) || os(visionOS)
272272
// `os_unfair_lock`s do not need to be explicitly destroyed
273273
#elseif os(Windows)
274274
// `SRWLOCK`s do not need to be explicitly destroyed
@@ -289,7 +289,7 @@ fileprivate class _Lock {
289289

290290
@discardableResult
291291
func withLock<T>(_ body: () -> T) -> T {
292-
#if os(iOS) || os(macOS) || os(tvOS) || os(watchOS)
292+
#if os(iOS) || os(macOS) || os(tvOS) || os(watchOS) || os(visionOS)
293293
unsafe os_unfair_lock_lock(self.underlying)
294294
#elseif os(Windows)
295295
AcquireSRWLockExclusive(self.underlying)
@@ -302,7 +302,7 @@ fileprivate class _Lock {
302302
#endif
303303

304304
defer {
305-
#if os(iOS) || os(macOS) || os(tvOS) || os(watchOS)
305+
#if os(iOS) || os(macOS) || os(tvOS) || os(watchOS) || os(visionOS)
306306
unsafe os_unfair_lock_unlock(self.underlying)
307307
#elseif os(Windows)
308308
ReleaseSRWLockExclusive(self.underlying)

0 commit comments

Comments
 (0)