lock

internal fun lock(lock: ReentrantLock, block: () -> Unit)(source)

The block will run in with the reentrant lock.

Parameters

lock

java.util.concurrent.locks.ReentrantLock The reentrant lock to use.

block

() -> Unit The block of code to execute within the lock.