LockMechanism

public enum LockMechanism

Represents different mechanisms that can be used for locking.

  • A mechanism that peforms no read or write locking. This should only be used to optimize for scenarios where a lock is required but thread-safety can be guaranteed through other means. (In other words, if you use this value, you are assuming responsibility for ensuring thread-safety on your own.)

    Declaration

    Swift

    case none
  • A mechanism that relies on a CriticalSection for a re-entrant mutual exclusion lock.

    Declaration

    Swift

    case mutex
  • Creates a new Lock instance that uses the locking mechanism specified by the value of the receiver.

    Declaration

    Swift

    public func createLock()
            -> Lock

    Return Value

    The new Lock.

  • Creates a new FastWriteLock instance that uses the locking mechanism specified by the value of the receiver.

    Declaration

    Swift

    public func createFastWriteLock()
            -> FastWriteLock

    Return Value

    The new FastWriteLock.