withWriterLock(_:)

Acquire a writer lock for the duration of the given block.

Metrics.swift:616
static func withWriterLock<T>(_ body: () throws -> T) rethrows -> T

Parameters

body

The block to execute while holding the lock.

Returns

The value returned by the block.