From 7594ef81d644163f07c3df10c0cff0b516b30b7c Mon Sep 17 00:00:00 2001 From: Nicklas Ansman Date: Wed, 1 Feb 2023 09:48:27 -0500 Subject: [PATCH 1/4] Update the wording for Dispatchers.Unconfined In my recent PR (#3607) I changed the example for `Dispatchers.Unconfined` but the rest of the documentation still mentions two `withContext` which isn't correct any longer. --- kotlinx-coroutines-core/common/src/Dispatchers.common.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kotlinx-coroutines-core/common/src/Dispatchers.common.kt b/kotlinx-coroutines-core/common/src/Dispatchers.common.kt index 7ed4e126f0..fd491fa13a 100644 --- a/kotlinx-coroutines-core/common/src/Dispatchers.common.kt +++ b/kotlinx-coroutines-core/common/src/Dispatchers.common.kt @@ -64,7 +64,7 @@ public expect object Dispatchers { * println("Done") * ``` * Can print both "1 2 3" and "1 3 2". This is an implementation detail that can be changed. - * However, it is guaranteed that "Done" will be printed only when both `withContext` calls are completed. + * However, it is guaranteed that "Done" will be printed only the `withContext` call is completed. * * If you need your coroutine to be confined to a particular thread or a thread-pool after resumption, * but still want to execute it in the current call-frame until its first suspension, you can use From db2b938585ca93f82b849295fee796338d4958b5 Mon Sep 17 00:00:00 2001 From: Nicklas Ansman Date: Wed, 1 Feb 2023 09:57:15 -0500 Subject: [PATCH 2/4] Tweak the wording --- kotlinx-coroutines-core/common/src/Dispatchers.common.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kotlinx-coroutines-core/common/src/Dispatchers.common.kt b/kotlinx-coroutines-core/common/src/Dispatchers.common.kt index fd491fa13a..3595e0c494 100644 --- a/kotlinx-coroutines-core/common/src/Dispatchers.common.kt +++ b/kotlinx-coroutines-core/common/src/Dispatchers.common.kt @@ -64,7 +64,7 @@ public expect object Dispatchers { * println("Done") * ``` * Can print both "1 2 3" and "1 3 2". This is an implementation detail that can be changed. - * However, it is guaranteed that "Done" will be printed only the `withContext` call is completed. + * However, it is guaranteed that "Done" will only be printed once the `withContext` call is completed. * * If you need your coroutine to be confined to a particular thread or a thread-pool after resumption, * but still want to execute it in the current call-frame until its first suspension, you can use From 0fc422e0ade9d55639b6e789a82d4009c4834c0d Mon Sep 17 00:00:00 2001 From: Nicklas Ansman Date: Wed, 1 Feb 2023 10:04:52 -0500 Subject: [PATCH 3/4] Update kotlinx-coroutines-core/common/src/Dispatchers.common.kt Co-authored-by: Dmitry Khalanskiy <52952525+dkhalanskyjb@users.noreply.github.com> --- kotlinx-coroutines-core/common/src/Dispatchers.common.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kotlinx-coroutines-core/common/src/Dispatchers.common.kt b/kotlinx-coroutines-core/common/src/Dispatchers.common.kt index 3595e0c494..7fb716dc85 100644 --- a/kotlinx-coroutines-core/common/src/Dispatchers.common.kt +++ b/kotlinx-coroutines-core/common/src/Dispatchers.common.kt @@ -64,7 +64,7 @@ public expect object Dispatchers { * println("Done") * ``` * Can print both "1 2 3" and "1 3 2". This is an implementation detail that can be changed. - * However, it is guaranteed that "Done" will only be printed once the `withContext` call is completed. + * However, it is guaranteed that "Done" will only be printed once both the `withContext` call and the inner `launch` are completed. * * If you need your coroutine to be confined to a particular thread or a thread-pool after resumption, * but still want to execute it in the current call-frame until its first suspension, you can use From 5d8a0bec7e1674fbb93cb68bf2a483bff60fc72d Mon Sep 17 00:00:00 2001 From: Dmitry Khalanskiy <52952525+dkhalanskyjb@users.noreply.github.com> Date: Wed, 1 Feb 2023 18:12:18 +0300 Subject: [PATCH 4/4] Update Dispatchers.common.kt Reword a bit for succinctness --- kotlinx-coroutines-core/common/src/Dispatchers.common.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kotlinx-coroutines-core/common/src/Dispatchers.common.kt b/kotlinx-coroutines-core/common/src/Dispatchers.common.kt index 7fb716dc85..11ec7cf764 100644 --- a/kotlinx-coroutines-core/common/src/Dispatchers.common.kt +++ b/kotlinx-coroutines-core/common/src/Dispatchers.common.kt @@ -64,7 +64,7 @@ public expect object Dispatchers { * println("Done") * ``` * Can print both "1 2 3" and "1 3 2". This is an implementation detail that can be changed. - * However, it is guaranteed that "Done" will only be printed once both the `withContext` call and the inner `launch` are completed. + * However, it is guaranteed that "Done" will only be printed once the code in both `withContext` and `launch` completes. * * If you need your coroutine to be confined to a particular thread or a thread-pool after resumption, * but still want to execute it in the current call-frame until its first suspension, you can use