Skip to content

Fix: Use NSRecursiveLock for ThreadSafeSingleton#4

Merged
rickhohler merged 2 commits intomainfrom
fix/recursive-lock-singleton
Dec 13, 2025
Merged

Fix: Use NSRecursiveLock for ThreadSafeSingleton#4
rickhohler merged 2 commits intomainfrom
fix/recursive-lock-singleton

Conversation

@rickhohler
Copy link
Collaborator

@rickhohler rickhohler commented Dec 13, 2025

Switches from NSLock to NSRecursiveLock in ThreadSafeSingleton to allow for safe nested singleton initialization (e.g. valid subclass singletons initializing other singletons in their init).

Additional Improvements (v1.1.1)

  • Concurrency Fixes: Resolved Sendable conformance warnings and unnecessary await calls in MergerTests and internal classes.
  • Hashing Enhancements:
    • Added convenient Data extensions: sha256 and sha256Hex.
    • Improved HashError to conform to LocalizedError for better error messages.
  • Documentation Updates:
    • Updated CHANGELOG.md to version 1.1.1.
    • Updated EXAMPLES.md to show new hashing extensions.
    • Corrected ThreadSafeSingleton usage example in code comments to include required createShared() override.
  • Cleanup: Removed temporary test_import.swift file.

@codecov
Copy link

codecov bot commented Dec 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@rickhohler rickhohler merged commit ed038f0 into main Dec 13, 2025
2 checks passed
@rickhohler rickhohler deleted the fix/recursive-lock-singleton branch December 13, 2025 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant