withLock

inline fun <T> Lock.withLock(action: () -> T): T

Executes the given action under this lock.

Return

the return value of the action.