Skip to content

Commit 74a0f03

Browse files
committed
Update to fix tests
1 parent 169b55a commit 74a0f03

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Sources/Cache/Cache/AnyCacheable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ public class AnyCacheable: Cacheable, @unchecked Sendable {
44
public typealias Key = AnyHashable
55
public typealias Value = Any
66

7-
private let lock = NSLock()
7+
private let lock = NSRecursiveLock()
88
private var cache: any Cacheable
99

1010
private var cacheGet: ((AnyHashable) -> Any?)!

Sources/Cache/Cache/ComposableCache.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#if !os(Windows)
22
import Foundation
33
public struct ComposableCache<Key: Hashable>: Cacheable, @unchecked Sendable {
4-
private let lock = NSLock()
4+
private let lock = NSRecursiveLock()
55
private let caches: [AnyCacheable]
66

77
public init(caches: [any Cacheable]) {

Sources/Cache/Cache/LRUCache.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Error Handling: The set(value:forKey:) function does not throw any error. Instea
1212
The `LRUCache` class is a subclass of the `Cache` class. You can use its `capacity` property to specify the maximum number of key-value pairs that the cache can hold.
1313
*/
1414
public class LRUCache<Key: Hashable, Value>: Cache<Key, Value>, @unchecked Sendable {
15-
private let lock = NSLock()
15+
private let lock = NSRecursiveLock()
1616
private var keys: [Key]
1717

1818
/// The maximum capacity of the cache.

0 commit comments

Comments
 (0)