Provides an unsafe view over the lock and its value.
struct Unsafe
s21NIOConcurrencyHelpers17NIOLockedValueBoxV6UnsafeV
7L93V
import NIOConcurrencyHelpers
struct NIOLockedValueBox<Value>
Provides locked access to Value.
Value
init(_ value: Value)
Initialize the Value.
var unsafe: Unsafe { get }
func withLockedValue<T>(_ mutate: (inout Value) throws -> T) rethrows -> T
Access the Value, allowing mutation of it.
func lock()
Manually acquire the lock.
func unlock()
Manually release the lock.
func withValueAssumingLockIsAcquired<Result>(_ mutate: (_ value: inout Value) throws -> Result) rethrows -> Result
Mutate the value, assuming the lock has been acquired manually.