Changes
Page history
Update Kotlin coroutines
authored
Jul 30, 2023
by
umaumax
Show whitespace changes
Inline
Side-by-side
Kotlin-coroutines.md
View page @
7f0026ae
...
...
@@ -53,6 +53,9 @@ fun main(args: Array<String>) = runBlocking {
`var x = 0`
を
`var x = AtomicInteger()`
、
`x += 1`
を
`x.incrementAndGet()`
とすると、期待した結果となる(ただし、awaitの返り値はすべて10000である可能性が高い)
### await
`.await()`
を実行すると、その結果が返却されるまでこのコードの次の処理はブロックされる
## Dispatchers
[
Dispatchers.Default
](
https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-dispatchers/-default.html
)
...
...
...
...