The job2
will throw an ArithmaticException thus making the parent job cancelled. Normally we will get a CancellationException when calling the job2.join()
but there is otherwise.
suspend fun main() = runBlocking {
log(1)
val job = launch(Dispatchers.Unconfined) {
log(2)
val job2 = launch(Dispatchers.Default) {
log(3)