Skip to content

Commit 52a3ae5

Browse files
authored
Update the code example for Dispatchers.Unconfined (#3607)
The previous example used `withContext` which is guaranteed to complete before the code after it runs. The updated example uses `launch` which I think was originally intended. Fixes #3605 Fixes https://youtrack.jetbrains.com/issue/KT-47032/
1 parent e7ddb2d commit 52a3ae5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kotlinx-coroutines-core/common/src/Dispatchers.common.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public expect object Dispatchers {
5656
* ```
5757
* withContext(Dispatchers.Unconfined) {
5858
* println(1)
59-
* withContext(Dispatchers.Unconfined) { // Nested unconfined
59+
* launch(Dispatchers.Unconfined) { // Nested unconfined
6060
* println(2)
6161
* }
6262
* println(3)

0 commit comments

Comments
 (0)