aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictoria Petrakovich <78360457+PetrakovichVictoria@users.noreply.github.com>2024-04-03 12:27:49 +0200
committerGitHub <noreply@github.com>2024-04-03 12:27:49 +0200
commit74774df13a8dd30980a96add574c19b2f2edbfca (patch)
tree799a7a6c02ee158daa098df2468792ad0841f0cd
parentd106ac7c362c54fdeffacc6af0b161ed107babaa (diff)
downloadkotlinx.coroutines-74774df13a8dd30980a96add574c19b2f2edbfca.tar.gz
Docs: reference to The Hitchhiker's Guide to the Galaxy (#4082)
At the end of the book, they multiply 6 * 7 :)
-rw-r--r--docs/topics/coroutine-context-and-dispatchers.md8
-rw-r--r--kotlinx-coroutines-core/jvm/test/guide/example-context-08.kt6
-rw-r--r--kotlinx-coroutines-core/jvm/test/guide/test/DispatcherGuideTest.kt2
3 files changed, 8 insertions, 8 deletions
diff --git a/docs/topics/coroutine-context-and-dispatchers.md b/docs/topics/coroutine-context-and-dispatchers.md
index 969bd21e..4cc67f04 100644
--- a/docs/topics/coroutine-context-and-dispatchers.md
+++ b/docs/topics/coroutine-context-and-dispatchers.md
@@ -420,14 +420,14 @@ fun main() = runBlocking(CoroutineName("main")) {
val v1 = async(CoroutineName("v1coroutine")) {
delay(500)
log("Computing v1")
- 252
+ 6
}
val v2 = async(CoroutineName("v2coroutine")) {
delay(1000)
log("Computing v2")
- 6
+ 7
}
- log("The answer for v1 / v2 = ${v1.await() / v2.await()}")
+ log("The answer for v1 * v2 = ${v1.await() * v2.await()}")
//sampleEnd
}
```
@@ -443,7 +443,7 @@ The output it produces with `-Dkotlinx.coroutines.debug` JVM option is similar t
[main @main#1] Started main coroutine
[main @v1coroutine#2] Computing v1
[main @v2coroutine#3] Computing v2
-[main @main#1] The answer for v1 / v2 = 42
+[main @main#1] The answer for v1 * v2 = 42
```
<!--- TEST FLEXIBLE_THREAD -->
diff --git a/kotlinx-coroutines-core/jvm/test/guide/example-context-08.kt b/kotlinx-coroutines-core/jvm/test/guide/example-context-08.kt
index 0ab1a3ee..bb871662 100644
--- a/kotlinx-coroutines-core/jvm/test/guide/example-context-08.kt
+++ b/kotlinx-coroutines-core/jvm/test/guide/example-context-08.kt
@@ -11,12 +11,12 @@ fun main() = runBlocking(CoroutineName("main")) {
val v1 = async(CoroutineName("v1coroutine")) {
delay(500)
log("Computing v1")
- 252
+ 6
}
val v2 = async(CoroutineName("v2coroutine")) {
delay(1000)
log("Computing v2")
- 6
+ 7
}
- log("The answer for v1 / v2 = ${v1.await() / v2.await()}")
+ log("The answer for v1 * v2 = ${v1.await() * v2.await()}")
}
diff --git a/kotlinx-coroutines-core/jvm/test/guide/test/DispatcherGuideTest.kt b/kotlinx-coroutines-core/jvm/test/guide/test/DispatcherGuideTest.kt
index 5a4bb993..1cf6c2bd 100644
--- a/kotlinx-coroutines-core/jvm/test/guide/test/DispatcherGuideTest.kt
+++ b/kotlinx-coroutines-core/jvm/test/guide/test/DispatcherGuideTest.kt
@@ -77,7 +77,7 @@ class DispatcherGuideTest {
"[main @main#1] Started main coroutine",
"[main @v1coroutine#2] Computing v1",
"[main @v2coroutine#3] Computing v2",
- "[main @main#1] The answer for v1 / v2 = 42"
+ "[main @main#1] The answer for v1 * v2 = 42"
)
}