Mutex

public class Mutex: Lockable

Swift wrapper class for pthread_mutex_t.
Note that this is a non-recursive version.

Seealso

Locakble
  • Mutex errors.

    See more

    Declaration

    Swift

    public enum Error: Swift.Error
  • Initializes a mutex object.

    Throws

    Mutex.Error on failure.

    Declaration

    Swift

    public required init() throws
  • Locks the mutex.

    Declaration

    Swift

    public func lock()
  • Unlocks the mutex.

    Declaration

    Swift

    public func unlock()
  • Tries to lock the mutex.

    Declaration

    Swift

    public func tryLock() -> Bool

    Return Value

    true if the mutex was successfully locked, otherwise false.