Skip to content

Commit 6d9d5ea

Browse files
committed
Added Sendable conformance to NSRecursiveLock, NSConditionLock and NSCondition
1 parent cf07ace commit 6d9d5ea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/Foundation/NSLock.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ extension NSLock {
166166
}
167167

168168
#if SWIFT_CORELIBS_FOUNDATION_HAS_THREADS
169-
open class NSConditionLock : NSObject, NSLocking {
169+
open class NSConditionLock : NSObject, NSLocking, @unchecked Sendable {
170170
internal var _cond = NSCondition()
171171
internal var _value: Int
172172
internal var _thread: _swift_CFThreadRef?
@@ -260,7 +260,7 @@ open class NSConditionLock : NSObject, NSLocking {
260260
}
261261
#endif
262262

263-
open class NSRecursiveLock: NSObject, NSLocking {
263+
open class NSRecursiveLock: NSObject, NSLocking, @unchecked Sendable {
264264
internal var mutex = _RecursiveMutexPointer.allocate(capacity: 1)
265265
#if os(macOS) || os(iOS) || os(Windows)
266266
private var timeoutCond = _ConditionVariablePointer.allocate(capacity: 1)
@@ -382,7 +382,7 @@ open class NSRecursiveLock: NSObject, NSLocking {
382382
open var name: String?
383383
}
384384

385-
open class NSCondition: NSObject, NSLocking {
385+
open class NSCondition: NSObject, NSLocking, @unchecked Sendable {
386386
internal var mutex = _MutexPointer.allocate(capacity: 1)
387387
internal var cond = _ConditionVariablePointer.allocate(capacity: 1)
388388

0 commit comments

Comments
 (0)