@@ -7,7 +7,7 @@ import kotlin.coroutines.*
7
7
import kotlin.native.concurrent.*
8
8
9
9
/* *
10
- * Runs new coroutine and **blocks** current thread _interruptibly_ until its completion.
10
+ * Runs a new coroutine and **blocks** the current thread _interruptibly_ until its completion.
11
11
*
12
12
* It is designed to bridge regular blocking code to libraries that are written in suspending style, to be used in
13
13
* `main` functions and in tests.
@@ -25,21 +25,21 @@ import kotlin.native.concurrent.*
25
25
* Here, instead of releasing the thread on which `loadConfiguration` runs if `fetchConfigurationData` suspends, it will
26
26
* block, potentially leading to thread starvation issues.
27
27
*
28
- * The default [CoroutineDispatcher] for this builder in an implementation of [EventLoop] that processes continuations
28
+ * The default [CoroutineDispatcher] for this builder is an internal implementation of event loop that processes continuations
29
29
* in this blocked thread until the completion of this coroutine.
30
30
* See [CoroutineDispatcher] for the other implementations that are provided by `kotlinx.coroutines`.
31
31
*
32
32
* When [CoroutineDispatcher] is explicitly specified in the [context], then the new coroutine runs in the context of
33
- * the specified dispatcher while the current thread is blocked. If the specified dispatcher implements [EventLoop]
34
- * interface and this `runBlocking` invocation is performed from inside of the this event loop's thread, then
35
- * this event loop is processed using its [processNextEvent][EventLoop.processNextEvent] method until coroutine completes.
33
+ * the specified dispatcher while the current thread is blocked. If the specified dispatcher is an event loop of another `runBlocking`,
34
+ * then this invocation uses the outer event loop.
36
35
*
37
36
* If this blocked thread is interrupted (see [Thread.interrupt]), then the coroutine job is cancelled and
38
37
* this `runBlocking` invocation throws [InterruptedException].
39
38
*
40
- * See [newCoroutineContext] for a description of debugging facilities that are available for newly created coroutine.
39
+ * See [newCoroutineContext][CoroutineScope.newCoroutineContext] for a description of debugging facilities that are available
40
+ * for a newly created coroutine.
41
41
*
42
- * @param context context of the coroutine. The default value is an implementation of [EventLoop] .
42
+ * @param context the context of the coroutine. The default value is an event loop on the current thread .
43
43
* @param block the coroutine code.
44
44
*/
45
45
public actual fun <T > runBlocking (context : CoroutineContext , block : suspend CoroutineScope .() -> T ): T {
0 commit comments