Lock

class Lock

A wrapper for NSLock that can also check if the lock is held.

  • the NSLOCK itself

    Declaration

    Swift

    private let nslock: NSLock
  • A boolean value indicating whether the lock is held or not.

    Declaration

    Swift

    private var isHeld: Bool
  • Locks the lock.

    Declaration

    Swift

    func lock()
  • Unlocks the lock.

    Declaration

    Swift

    func unlock()
  • Returns a Boolean value indicating whether the lock is currently held.

    Declaration

    Swift

    func isLockHeld() -> Bool

    Return Value

    true if the lock is held, false otherwise.