@@ -238,7 +238,7 @@ public struct LocalTestingDistributedActorSystemError: DistributedActorSystemErr
238
238
@available ( SwiftStdlib 5 . 7 , * )
239
239
@safe
240
240
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)
242
242
private let underlying : UnsafeMutablePointer < os_unfair_lock >
243
243
#elseif os(Windows)
244
244
private let underlying : UnsafeMutablePointer < SRWLOCK >
@@ -251,7 +251,7 @@ fileprivate class _Lock {
251
251
#endif
252
252
253
253
init ( ) {
254
- #if os(iOS) || os(macOS) || os(tvOS) || os(watchOS)
254
+ #if os(iOS) || os(macOS) || os(tvOS) || os(watchOS) || os(visionOS)
255
255
self . underlying = UnsafeMutablePointer . allocate ( capacity: 1 )
256
256
unsafe self. underlying . initialize ( to: os_unfair_lock ( ) )
257
257
#elseif os(Windows)
@@ -268,7 +268,7 @@ fileprivate class _Lock {
268
268
}
269
269
270
270
deinit {
271
- #if os(iOS) || os(macOS) || os(tvOS) || os(watchOS)
271
+ #if os(iOS) || os(macOS) || os(tvOS) || os(watchOS) || os(visionOS)
272
272
// `os_unfair_lock`s do not need to be explicitly destroyed
273
273
#elseif os(Windows)
274
274
// `SRWLOCK`s do not need to be explicitly destroyed
@@ -289,7 +289,7 @@ fileprivate class _Lock {
289
289
290
290
@discardableResult
291
291
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)
293
293
unsafe os_unfair_lock_lock( self . underlying)
294
294
#elseif os(Windows)
295
295
AcquireSRWLockExclusive ( self . underlying)
@@ -302,7 +302,7 @@ fileprivate class _Lock {
302
302
#endif
303
303
304
304
defer {
305
- #if os(iOS) || os(macOS) || os(tvOS) || os(watchOS)
305
+ #if os(iOS) || os(macOS) || os(tvOS) || os(watchOS) || os(visionOS)
306
306
unsafe os_unfair_lock_unlock( self . underlying)
307
307
#elseif os(Windows)
308
308
ReleaseSRWLockExclusive ( self . underlying)
0 commit comments