Commit 9471103
authored
Refactor Cache locking mechanism to use NSRecursiveLock for improved thread safety and prevent deadlocks. Added comprehensive thread safety tests to validate the fix and ensure no new locking issues are introduced. (#22)
* Refactor Cache locking mechanism to use NSRecursiveLock for improved thread safety and prevent deadlocks. Added comprehensive thread safety tests to validate the fix and ensure no new locking issues are introduced.
* Refactor ThreadSafetyTests to improve clarity and maintain compatibility with Windows. Added type annotations for ComposableCache and AnyCacheable instances, and wrapped tests in conditional compilation to exclude them on Windows.
* Add cache initialization in thread safety tests to avoid redundant instantiation. This change enhances test clarity and performance by reusing the cache instance across multiple operations.
* Enhance thread safety tests by refining cache initialization and improving test clarity. Updated comments to reflect changes in locking mechanisms and added new test scenarios to validate cache behavior under high contention and mixed operations.1 parent c0e89d0 commit 9471103
File tree
2 files changed
+548
-3
lines changed- Sources/Cache/Cache
- Tests/CacheTests
2 files changed
+548
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
34 | | - | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
0 commit comments