1 // This file was automatically generated from coroutine-context-and-dispatchers.md by Knit tool. Do not edit. 2 package kotlinx.coroutines.guide.exampleContext08 3 4 import kotlinx.coroutines.* 5 lognull6fun log(msg: String) = println("[${Thread.currentThread().name}] $msg") 7 8 fun main() = runBlocking(CoroutineName("main")) { 9 log("Started main coroutine") 10 // run two background value computations 11 val v1 = async(CoroutineName("v1coroutine")) { 12 delay(500) 13 log("Computing v1") 14 6 15 } 16 val v2 = async(CoroutineName("v2coroutine")) { 17 delay(1000) 18 log("Computing v2") 19 7 20 } 21 log("The answer for v1 * v2 = ${v1.await() * v2.await()}") 22 } 23