File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
kotlinx-coroutines-core/common/src Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,10 @@ private class LazyDeferredCoroutine<T>(
133133 * which means that if the original [coroutineContext], in which `withContext` was invoked,
134134 * is cancelled by the time its dispatcher starts to execute the code,
135135 * it discards the result of `withContext` and throws [CancellationException].
136+ *
137+ * The cancellation behaviour described above is enabled if and only if the dispatcher is being changed.
138+ * For example, when using `withContext(NonCancellable) { ... }` there is no change in dispatcher and
139+ * this call will not be cancelled neither on entry to the block inside `withContext` nor on exit from it.
136140 */
137141public suspend fun <T > withContext (
138142 context : CoroutineContext ,
You can’t perform that action at this time.
0 commit comments