@@ -14,7 +14,7 @@ internal expect fun wrapContextWithDebug(context: CoroutineContext): CoroutineCo
14
14
/* *
15
15
* Executes a block using a given coroutine context.
16
16
*/
17
- internal actual inline fun <T > withCoroutineContext (context : CoroutineContext , countOrElement : Any? , block : () -> T ): T {
17
+ internal inline fun <T > withCoroutineContext (context : CoroutineContext , countOrElement : Any? , block : () -> T ): T {
18
18
val oldValue = updateThreadContext(context, countOrElement)
19
19
try {
20
20
return block()
@@ -26,7 +26,7 @@ internal actual inline fun <T> withCoroutineContext(context: CoroutineContext, c
26
26
/* *
27
27
* Executes a block using a context of a given continuation.
28
28
*/
29
- internal actual inline fun <T > withContinuationContext (continuation : Continuation <* >, countOrElement : Any? , block : () -> T ): T {
29
+ internal inline fun <T > withContinuationContext (continuation : Continuation <* >, countOrElement : Any? , block : () -> T ): T {
30
30
val context = continuation.context
31
31
val oldValue = updateThreadContext(context, countOrElement)
32
32
val undispatchedCompletion = if (oldValue != = NO_THREAD_ELEMENTS ) {
@@ -44,7 +44,7 @@ internal actual inline fun <T> withContinuationContext(continuation: Continuatio
44
44
}
45
45
}
46
46
47
- internal fun Continuation <* >.updateUndispatchedCompletion (context : CoroutineContext , oldValue : Any? ): UndispatchedCoroutine <* >? {
47
+ private fun Continuation <* >.updateUndispatchedCompletion (context : CoroutineContext , oldValue : Any? ): UndispatchedCoroutine <* >? {
48
48
if (this !is CoroutineStackFrame ) return null
49
49
/*
50
50
* Fast-path to detect whether we have undispatched coroutine at all in our stack.
@@ -65,7 +65,7 @@ internal fun Continuation<*>.updateUndispatchedCompletion(context: CoroutineCont
65
65
return completion
66
66
}
67
67
68
- internal tailrec fun CoroutineStackFrame.undispatchedCompletion (): UndispatchedCoroutine <* >? {
68
+ private tailrec fun CoroutineStackFrame.undispatchedCompletion (): UndispatchedCoroutine <* >? {
69
69
// Find direct completion of this continuation
70
70
val completion: CoroutineStackFrame = when (this ) {
71
71
is DispatchedCoroutine <* > -> return null
@@ -79,7 +79,7 @@ internal tailrec fun CoroutineStackFrame.undispatchedCompletion(): UndispatchedC
79
79
* Marker indicating that [UndispatchedCoroutine] exists somewhere up in the stack.
80
80
* Used as a performance optimization to avoid stack walking where it is not necessary.
81
81
*/
82
- private object UndispatchedMarker: CoroutineContext.Element, CoroutineContext.Key<UndispatchedMarker> {
82
+ internal object UndispatchedMarker: CoroutineContext.Element, CoroutineContext.Key<UndispatchedMarker> {
83
83
override val key: CoroutineContext .Key <* >
84
84
get() = this
85
85
}
0 commit comments