await

fun <T> await(block: suspend () -> T): T

Runs block and blocks the calling thread until it completes.

Do not call this from a thread the coroutine itself needs, or it will deadlock.


fun <T> await(coroutineContext: CoroutineContext, block: suspend () -> T): T

Like await, with coroutineContext added to the call.