Initializerswift-nio 2.72.0NIOConcurrencyHelpers
init(value:)
Create the lock, and initialize the state variable to value
.
init(value: T)
Parameters
- value
The initial value to give the state variable.
Other members in extension
Instance members
var value: T
The value of the state variable.
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
.