Improper Locking (ARCH9039)
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Key swift.async.improper-locking · Severity warning · Category async
Flags NSLock / os_unfair_lock use where lock() has no matching unlock() on every path (no defer), and objc_sync_enter(self).
Incorrect
Section titled “Incorrect”lock.lock()guard ok else { return }lock.unlock()Correct
Section titled “Correct”lock.lock(); defer { lock.unlock() }Pair lock() with defer { unlock() }, or use withLock { }.