This fixes an arithmetic overflow crash on iOS 17 caused by the fallback lock. In iOS 17, Swift Mutexes are not available, so we have a fallback class for NdbUseLock that does not make use of them. This allows some thread safety for iOS 17 users, but unfortunately not as much as iOS 18+ users. This attempts to fix those remaining race conditions and subsequent crashes by using `NSLock` in the fallback class, which is available on iOS 17. Closes: https://github.com/damus-io/damus/issues/3512 Changelog-Fixed: Fixed a crash on iOS 17 that would happen on startup Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
10 KiB
10 KiB