File tree 1 file changed +6
-1
lines changed
kotlinx-coroutines-core/jvm/src
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import kotlinx.atomicfu.*
8
8
import kotlin.coroutines.*
9
9
10
10
/* *
11
- * Calls the specified [block] with a given coroutine context in a interruptible manner.
11
+ * Calls the specified [block] with a given coroutine context in an interruptible manner.
12
12
* The blocking code block will be interrupted and this function will throw [CancellationException]
13
13
* if the coroutine is cancelled.
14
14
*
@@ -30,6 +30,11 @@ import kotlin.coroutines.*
30
30
* suspend fun <T> BlockingQueue<T>.awaitTake(): T =
31
31
* runInterruptible(Dispatchers.IO) { queue.take() }
32
32
* ```
33
+ *
34
+ * `runInterruptible` uses [withContext] as an underlying mechanism for switching context,
35
+ * meaning that the supplied [block] is invoked in an [undispatched][CoroutineStart.UNDISPATCHED]
36
+ * manner directly by the caller if [CoroutineDispatcher] from the current [coroutineContext][currentCoroutineContext]
37
+ * is the same as the one supplied in [context].
33
38
*/
34
39
public suspend fun <T > runInterruptible (
35
40
context : CoroutineContext = EmptyCoroutineContext ,
You can’t perform that action at this time.
0 commit comments