<lambda>null1 // This file was automatically generated from coroutine-context-and-dispatchers.md by Knit tool. Do not edit.
2 package kotlinx.coroutines.guide.exampleContext04
3 
4 import kotlinx.coroutines.*
5 
6 fun log(msg: String) = println("[${Thread.currentThread().name}] $msg")
7 
8 fun main() {
9     newSingleThreadContext("Ctx1").use { ctx1 ->
10         newSingleThreadContext("Ctx2").use { ctx2 ->
11             runBlocking(ctx1) {
12                 log("Started in ctx1")
13                 withContext(ctx2) {
14                     log("Working in ctx2")
15                 }
16                 log("Back to ctx1")
17             }
18         }
19     }
20 }
21