Instance Propertyswift-nio 2.72.0NIOConcurrencyHelpers
value
The value of the state variable.
lock.swift:176var value: T { get }
Obtaining the value of the state variable requires acquiring the lock. This means that it is not safe to access this property while holding the lock: it is only safe to use it when not holding it.
Other members in extension
Type members
init(value: T
) Create the lock, and initialize the state variable to
value
.
Instance members
func lock(
) Acquire the lock, regardless of the value of the state variable.
func lock(whenValue: T
) Acquire the lock when the state variable is equal to
wantedValue
.func lock(whenValue: T, timeoutSeconds: Double
) -> Bool Acquire the lock when the state variable is equal to
wantedValue
, waiting no more thantimeoutSeconds
seconds.func unlock(
) Release the lock, regardless of the value of the state variable.
func unlock(withValue: T
) Release the lock, setting the state variable to
newValue
.