Created
October 17, 2018 19:04
-
-
Save mayojava/5b4135902a4042102e0aafab1a1db910 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main(args: Array<String>) = runBlocking<Unit> { | |
launch(Dispatchers.Unconfined) { | |
println("current thread: ${Thread.currentThread().name}") | |
delay(1_000) | |
println("current thread: ${Thread.currentThread().name}") | |
} | |
} | |
//prints | |
current thread: main | |
current thread: kotlinx.coroutines.DefaultExecutor |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment