diff --git a/docs/shared-mutable-state-and-concurrency.md b/docs/shared-mutable-state-and-concurrency.md index 1a3c406472..96f6fdf129 100644 --- a/docs/shared-mutable-state-and-concurrency.md +++ b/docs/shared-mutable-state-and-concurrency.md @@ -187,7 +187,7 @@ suspend fun massiveRun(action: suspend () -> Unit) { } //sampleStart -var counter = AtomicInteger() +val counter = AtomicInteger() fun main() = runBlocking { withContext(Dispatchers.Default) { diff --git a/kotlinx-coroutines-core/jvm/test/guide/example-sync-03.kt b/kotlinx-coroutines-core/jvm/test/guide/example-sync-03.kt index 6c34149c93..8153c026b4 100644 --- a/kotlinx-coroutines-core/jvm/test/guide/example-sync-03.kt +++ b/kotlinx-coroutines-core/jvm/test/guide/example-sync-03.kt @@ -24,7 +24,7 @@ suspend fun massiveRun(action: suspend () -> Unit) { println("Completed ${n * k} actions in $time ms") } -var counter = AtomicInteger() +val counter = AtomicInteger() fun main() = runBlocking { withContext(Dispatchers.Default) {