Instance Methodpointfreeco.swift-concurrency-extras 1.3.1ConcurrencyExtras
setValue(_:)
Overwrite the isolated value with a new value.
func setValue(_ newValue: @autoclosure () throws -> Value) rethrows
Parameters
- newValue
The value to replace the current isolated value with.
// Isolate an integer for concurrent read/write access:
var count = LockIsolated(0)
func reset() {
// Reset it:
self.count.setValue(0)
}