Skip to content

Commit 74774df

Browse files
Docs: reference to The Hitchhiker's Guide to the Galaxy (#4082)
At the end of the book, they multiply 6 * 7 :)
1 parent d106ac7 commit 74774df

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

docs/topics/coroutine-context-and-dispatchers.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -420,14 +420,14 @@ fun main() = runBlocking(CoroutineName("main")) {
420420
val v1 = async(CoroutineName("v1coroutine")) {
421421
delay(500)
422422
log("Computing v1")
423-
252
423+
6
424424
}
425425
val v2 = async(CoroutineName("v2coroutine")) {
426426
delay(1000)
427427
log("Computing v2")
428-
6
428+
7
429429
}
430-
log("The answer for v1 / v2 = ${v1.await() / v2.await()}")
430+
log("The answer for v1 * v2 = ${v1.await() * v2.await()}")
431431
//sampleEnd
432432
}
433433
```
@@ -443,7 +443,7 @@ The output it produces with `-Dkotlinx.coroutines.debug` JVM option is similar t
443443
[main @main#1] Started main coroutine
444444
[main @v1coroutine#2] Computing v1
445445
[main @v2coroutine#3] Computing v2
446-
[main @main#1] The answer for v1 / v2 = 42
446+
[main @main#1] The answer for v1 * v2 = 42
447447
```
448448

449449
<!--- TEST FLEXIBLE_THREAD -->

kotlinx-coroutines-core/jvm/test/guide/example-context-08.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ fun main() = runBlocking(CoroutineName("main")) {
1111
val v1 = async(CoroutineName("v1coroutine")) {
1212
delay(500)
1313
log("Computing v1")
14-
252
14+
6
1515
}
1616
val v2 = async(CoroutineName("v2coroutine")) {
1717
delay(1000)
1818
log("Computing v2")
19-
6
19+
7
2020
}
21-
log("The answer for v1 / v2 = ${v1.await() / v2.await()}")
21+
log("The answer for v1 * v2 = ${v1.await() * v2.await()}")
2222
}

kotlinx-coroutines-core/jvm/test/guide/test/DispatcherGuideTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class DispatcherGuideTest {
7777
"[main @main#1] Started main coroutine",
7878
"[main @v1coroutine#2] Computing v1",
7979
"[main @v2coroutine#3] Computing v2",
80-
"[main @main#1] The answer for v1 / v2 = 42"
80+
"[main @main#1] The answer for v1 * v2 = 42"
8181
)
8282
}
8383

0 commit comments

Comments
 (0)