runSynced

fun <T> runSynced(task: () -> T?): T?

Executes the given function task while holding the monitor of the given object lock and returns the task's result