@@ -24,10 +24,16 @@ import kotlin.coroutines.experimental.startCoroutine
24
24
* Defines start option for coroutines builders.
25
25
* It is used in `start` parameter of [launch], [async], and [actor][kotlinx.coroutines.experimental.channels.actor]
26
26
* coroutine builder functions.
27
+ *
28
+ * The summary of coroutine start options is:
29
+ * * [DEFAULT] -- immediately schedules coroutine for execution according to its context;
30
+ * * [LAZY] -- starts coroutine lazily, only when it is needed;
31
+ * * [ATOMIC] -- atomically (non-cancellably) schedules coroutine for execution according to its context;
32
+ * * [UNDISPATCHED] -- immediately executes coroutine until its first suspension point _in the current thread_.
27
33
*/
28
34
public enum class CoroutineStart {
29
35
/* *
30
- * Default -- schedules coroutine for execution according to its context.
36
+ * Default -- immediately schedules coroutine for execution according to its context.
31
37
*
32
38
* If the [CoroutineDispatcher] of the coroutine context returns `true` from [CoroutineDispatcher.isDispatchNeeded]
33
39
* function as most dispatchers do, then the coroutine code is dispatched for execution later, while the code that
@@ -56,8 +62,8 @@ public enum class CoroutineStart {
56
62
LAZY ,
57
63
58
64
/* *
59
- * Atomically schedules coroutines for execution according to its context. This is similar to [DEFAULT],
60
- * but the coroutine cannot be cancelled before it starts executing.
65
+ * Atomically (non-cancellably) schedules coroutine for execution according to its context.
66
+ * This is similar to [DEFAULT], but the coroutine cannot be cancelled before it starts executing.
61
67
*
62
68
* Cancellability of coroutine at suspension points depends on the particular implementation details of
63
69
* suspending functions as in [DEFAULT].
@@ -72,7 +78,7 @@ public enum class CoroutineStart {
72
78
UNDISPATCHED ;
73
79
74
80
/* *
75
- * Starts the corresponding block as a coroutine with this coroutine start strategy.
81
+ * Starts the corresponding block with receiver as a coroutine with this coroutine start strategy.
76
82
*
77
83
* * [DEFAULT] uses [startCoroutineCancellable].
78
84
* * [ATOMIC] uses [startCoroutine].
0 commit comments