Skip to content

Commit 1bd4349

Browse files
authored
Fixed val counter AtomicInteger in shared state example (#2063)
Fixes #2062
1 parent 1eeed50 commit 1bd4349

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: docs/shared-mutable-state-and-concurrency.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ suspend fun massiveRun(action: suspend () -> Unit) {
187187
}
188188

189189
//sampleStart
190-
var counter = AtomicInteger()
190+
val counter = AtomicInteger()
191191

192192
fun main() = runBlocking {
193193
withContext(Dispatchers.Default) {

Diff for: kotlinx-coroutines-core/jvm/test/guide/example-sync-03.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ suspend fun massiveRun(action: suspend () -> Unit) {
2424
println("Completed ${n * k} actions in $time ms")
2525
}
2626

27-
var counter = AtomicInteger()
27+
val counter = AtomicInteger()
2828

2929
fun main() = runBlocking {
3030
withContext(Dispatchers.Default) {

0 commit comments

Comments
 (0)