lock

fun <T> lock(value: T, isLocked: () -> Boolean): Lockable<T>

Creates a Lockable property delegate with the given initial value and a lock condition.