LockingProtocol

public protocol LockingProtocol

通用互斥锁协议

  • 加锁方法

    Declaration

    Swift

    func lock()
  • 解锁方法

    Declaration

    Swift

    func unlock()

LockingProtocol

  • around(_:) Extension method

    加锁方式执行闭包并返回值

    Declaration

    Swift

    public func around<T>(_ closure: () throws -> T) rethrows -> T
  • around(_:) Extension method

    加锁方式执行闭包

    Declaration

    Swift

    public func around(_ closure: () throws -> Void) rethrows