synchronized

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

Executes the given function block while holding the monitor of the given object lock.

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