withLock

expect inline fun <R> withLock(lock: Any, block: () -> R): R

Runs block while holding lock, so that concurrent callers on the same lock run one at a time under the platform's concurrency model.

Return

the result of block

actual inline fun <R> withLock(lock: Any, block: () -> R): R