@@ -62,11 +62,14 @@ public abstract class CoroutineDispatcher :
62
62
63
63
/* *
64
64
* Dispatches execution of a runnable [block] onto another thread in the given [context].
65
+ * This method should guarantee that the given [block] will be eventually invoked,
66
+ * otherwise the system may reach a deadlock state and never leave it.
67
+ * Cancellation mechanism is transparent for [CoroutineDispatcher] and is managed by [block] internals.
65
68
*
66
69
* This method should generally be exception-safe. An exception thrown from this method
67
70
* may leave the coroutines that use this dispatcher in the inconsistent and hard to debug state.
68
71
*
69
- * **Note**: This method must not immediately call [block]. Doing so would result in [StackOverflowError]
72
+ * This method must not immediately call [block]. Doing so would result in [StackOverflowError]
70
73
* when [yield] is repeatedly called from a loop. However, an implementation that returns `false` from
71
74
* [isDispatchNeeded] can delegate this function to `dispatch` method of [Dispatchers.Unconfined], which is
72
75
* integrated with [yield] to avoid this problem.
@@ -78,7 +81,7 @@ public abstract class CoroutineDispatcher :
78
81
* with a hint for the dispatcher that the current dispatch is triggered by a [yield] call, so that the execution of this
79
82
* continuation may be delayed in favor of already dispatched coroutines.
80
83
*
81
- * **Implementation note:** Though the `yield` marker may be passed as a part of [context], this
84
+ * Though the `yield` marker may be passed as a part of [context], this
82
85
* is a separate method for performance reasons.
83
86
*
84
87
* @suppress **This an internal API and should not be used from general code.**
0 commit comments