@@ -126,12 +126,15 @@ private class LazyDeferredCoroutine<T>(
126
126
* This suspending function is cancellable. It immediately checks for cancellation of
127
127
* the resulting context and throws [CancellationException] if it is not [active][CoroutineContext.isActive].
128
128
*
129
- * This function uses dispatcher from the new context, shifting execution of the [block] into the
130
- * different thread if a new dispatcher is specified, and back to the original dispatcher
131
- * when it completes. Note that the result of `withContext` invocation is
132
- * dispatched into the original context in a cancellable way with a **prompt cancellation guarantee**,
133
- * which means that if the original [coroutineContext], in which `withContext` was invoked,
134
- * is cancelled by the time its dispatcher starts to execute the code,
129
+ * Calls to [withContext] whose [context] argument provides a [CoroutineDispatcher] that is
130
+ * different from the current one, by necessity, perform additional dispatches: the [block]
131
+ * can not be executed immediately and needs to be dispatched for execution on
132
+ * the passed [CoroutineDispatcher], and then when the [block] completes, the execution
133
+ * has to shift back to the original dispatcher.
134
+ *
135
+ * Note that the result of `withContext` invocation is dispatched into the original context in a cancellable way
136
+ * with a **prompt cancellation guarantee**, which means that if the original [coroutineContext]
137
+ * in which `withContext` was invoked is cancelled by the time its dispatcher starts to execute the code,
135
138
* it discards the result of `withContext` and throws [CancellationException].
136
139
*
137
140
* The cancellation behaviour described above is enabled if and only if the dispatcher is being changed.
0 commit comments