The example of the coroutine from documentation does not work

0

I started to learn coroutine and have tried run the code from example structured-concurrency. But I got another result. If set delay(1000L) "Hellow, " only was printed and Process finished with exit code -1073741819 (0xC0000005). But if I set delay(100L) I get "Hello,World!". Why launch{} block not launch?

import kotlinx.coroutines.*

fun main() = runBlocking { // this: CoroutineScope
    launch { // launch a new coroutine in the scope of runBlocking
        delay(100L)
        println("World!")
    }
    println("Hello,")
}

screen 1 screen 2

kotlin
coroutine

1 Answer

0

Okey, I disabled the program "Punto switcher" and now all work correctly.


User contributions licensed under CC BY-SA 3.0