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
-
A read/write lock mechanism that relies on a
ReadWriteCoordinator
for a many-reader/single-writer that can provide optimizedFastWriteLock
performance.Declaration
Swift
case readWrite
-
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
.