RWLock
public class RWLock
Represents a reader-writer lock.
Note that this implementation is recursive.
Using a reader-writer lock, multiple treads can lock for reading, if no
writer is currently holding the lock.
Only one writer can hold the lock, preventing readers to acquire it.
-
Locing intent.
See moreDeclaration
Swift
public enum Intent -
Initializer.
Throws
RWLock.erroron initialization failure.Declaration
Swift
public init() throws -
Acquires the lock.
Seealso
RWLock.IntentDeclaration
Swift
public func lock( for intent: Intent ) -
Releases the lock.
Seealso
RWLock.IntentDeclaration
Swift
public func unlock( for intent: Intent ) -
Tries to acquires the lock.
Seealso
RWLock.IntentDeclaration
Swift
public func tryLock( for intent: Intent ) -> BoolReturn Value
trueif the lock was successfully locked, otherwisefalse.
View on GitHub
RWLock Class Reference