All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jsMain.Builders.kt Maven / Gradle / Ivy

There is a newer version: 1.10.1
Show newest version
/*
 * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
 */

package kotlinx.coroutines

import kotlinx.coroutines.intrinsics.*
import kotlin.coroutines.*
import kotlin.coroutines.intrinsics.*

@Suppress("NOTHING_TO_INLINE") // Save an entry on call stack
internal actual inline fun  startCoroutine(
    start: CoroutineStart,
    receiver: R,
    completion: Continuation,
    noinline block: suspend R.() -> T
) =
    startCoroutineImpl(start, receiver, completion, block)

@Suppress("NOTHING_TO_INLINE") // Save an entry on call stack
internal actual inline fun  saveLazyCoroutine(
    coroutine: AbstractCoroutine,
    receiver: R,
    noinline block: suspend R.() -> T
): Any =
    block.createCoroutineUnintercepted(receiver, coroutine)

@Suppress("NOTHING_TO_INLINE", "UNCHECKED_CAST") // Save an entry on call stack
internal actual inline fun  startLazyCoroutine(
    saved: Any,
    coroutine: AbstractCoroutine,
    receiver: R
) =
    (saved as Continuation).startCoroutineCancellable(coroutine)




© 2015 - 2025 Weber Informatics LLC | Privacy Policy