Mutex

@objc(VSSMutex)
open class Mutex : NSObject

Mutex

  • Init

    Declaration

    Swift

    override public init()
  • Tries to lock mutex

    Declaration

    Swift

    @objc
    public func trylock() -> Bool

    Return Value

    true if lock succeeded, false - otherwise

  • Locks mutex

    Throws

    MutexError

    Declaration

    Swift

    @objc
    public func lock() throws
  • Unlocks mutex

    Throws

    MutexError

    Declaration

    Swift

    @objc
    public func unlock() throws
  • Executes closure synchronously

    Throws

    MutexError

    Declaration

    Swift

    @objc
    public func executeSync(closure: () -> Void) throws

    Parameters

    closure

    closure to run

  • Executes closure synchronously

    Throws

    • MutexError
    • Rethrows from closure

    Declaration

    Swift

    public func executeSync(closure: () throws -> Void) throws

    Parameters

    closure

    closure to run