Skip to content
Update Kotlin coroutines authored by umaumax's avatar umaumax
...@@ -421,10 +421,18 @@ e.g. `java -Dkotlinx.coroutines.debug -jar ./app/build/libs/app-jvm.jar` ...@@ -421,10 +421,18 @@ e.g. `java -Dkotlinx.coroutines.debug -jar ./app/build/libs/app-jvm.jar`
e.g. e.g.
``` kotlin ``` kotlin
import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
// launch実行後すぐに次の行が実行されるパターン
GlobalScope.launch { GlobalScope.launch {
... ...
} }
// 即座にjoin待ちするパターン
var hoge: Hoge? = null
GlobalScope.launch {
hoge = genHoge()
}.join()
``` ```
### Error: Main method must return a value of type void ### Error: Main method must return a value of type void
... ...
......