Lockable

public protocol Lockable: NSLocking

Protocol for AtomicKit lockable objects.
This extends NSLocking by adding the tryLock method.

  • Required initializer.

    Throws

    An error if the lockable object failed to initialize.

    Declaration

    Swift

    init() throws
  • Tries to acquire the lock.

    Declaration

    Swift

    func tryLock() -> Bool

    Return Value

    true if the lock was successfully acquired, otherwise false.