Locking

public protocol Locking : AnyObject

Context indepedent locking. Non-recursive.

  • Locks. Be sure to balance with unlock

    Declaration

    Swift

    func lock()
  • Unlocks. Be sure to balance with lock

    Declaration

    Swift

    func unlock()
  • locker(_:) Extension method

    Locks and performs block

    Declaration

    Swift

    func locker<Result>(_ locked: () throws -> Result) rethrows -> Result

    Parameters

    locked

    locked function to perform

    Return Value

    value returned by the locker

  • locker(_:_:) Extension method

    Locks and performs block with one arugment

    Declaration

    Swift

    func locker<A, Result>(_ a: A, _ locked: (A) throws -> Result) rethrows -> Result

    Parameters

    locked

    locked function to perform

    Return Value

    value returned by the locker

  • locker(_:_:_:) Extension method

    Locks and performs block with two arugments

    Declaration

    Swift

    func locker<A, B, Result>(_ a: A, _ b: B, _ locked: (A, B) throws -> Result) rethrows -> Result

    Parameters

    locked

    locked function to perform

    Return Value

    value returned by the locker

  • locker(_:_:_:_:) Extension method

    Locks and performs block with three arugments

    Declaration

    Swift

    func locker<A, B, C, Result>(_ a: A, _ b: B, _ c: C,
                                 _ locked: (A, B, C) throws -> Result) rethrows -> Result

    Parameters

    locked

    locked function to perform

    Return Value

    value returned by the locker

  • locker(_:) Extension method

    Locks and performs block

    Declaration

    Swift

    func locker(_ locked: () -> Void)

    Parameters

    locked

    locked function to perform