withWriteLock

suspend fun <R> withWriteLock(block: suspend () -> R): R(source)

Executes the given block of code within a write lock. Suspends until the write lock can be acquired.