doWithLock

fun <T> doWithLock(f: Supplier<T>): T

Executes the given Supplier while holding the lock.