Instance Method
sync(_:)
Performs a given block of code while synchronizing over the type’s stored value.
@discardableResult func sync<Result, Error>(_ block: (inout Value) throws(Error) -> Result) throws(Error) -> Result where Error : Error
Parameters
blockA throwing block of work that optionally returns a value.
Return Value
Returns the returned value of block, if any.