diff --git a/Articles/Sources/Articles/DatabaseID.swift b/Articles/Sources/Articles/DatabaseID.swift index 86b6dc5de..32918a7ee 100644 --- a/Articles/Sources/Articles/DatabaseID.swift +++ b/Articles/Sources/Articles/DatabaseID.swift @@ -14,13 +14,12 @@ import RSCore // * Collisions aren’t going to happen with feed data private var databaseIDCache = [String: String]() -private var databaseIDCacheLock = os_unfair_lock_s() - +private var databaseIDCacheLock = NSLock() public func databaseIDWithString(_ s: String) -> String { - os_unfair_lock_lock(&databaseIDCacheLock) - defer { - os_unfair_lock_unlock(&databaseIDCacheLock) - } + databaseIdCacheLock.lock() + defer { + databaseIdCacheLock.unlock() + } if let identifier = databaseIDCache[s] { return identifier