1 /*
2  * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3  */
4 
5 // This file was automatically generated from exception-handling.md by Knit tool. Do not edit.
6 package kotlinx.coroutines.guide.exampleExceptions03
7 
8 import kotlinx.coroutines.*
9 
<lambda>null10 fun main() = runBlocking {
11     val job = launch {
12         val child = launch {
13             try {
14                 delay(Long.MAX_VALUE)
15             } finally {
16                 println("Child is cancelled")
17             }
18         }
19         yield()
20         println("Cancelling child")
21         child.cancel()
22         child.join()
23         yield()
24         println("Parent is not cancelled")
25     }
26     job.join()
27 }
28