stepango
03/11/2018, 3:47 PMfun main(args: Array<String>) {
launch(EmptyCoroutineContext) {
withContext(EmptyCoroutineContext) {
CompletableFuture.runAsync {
print("Hello")
}.await()
}
}
}
suspend fun <T> CompletableFuture<T>.await() = suspendCoroutine<T> { cont ->
cont.resume(join())
}
Hello
would never be printed in this casegildor
03/11/2018, 11:41 PM