nativeMain.internal.CoroutineExceptionHandlerImpl.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlinx-coroutines-core
Show all versions of kotlinx-coroutines-core
Coroutines support libraries for Kotlin
The newest version!
package kotlinx.coroutines.internal
import kotlinx.coroutines.*
import kotlin.coroutines.*
import kotlin.native.*
private val lock = SynchronizedObject()
internal actual val platformExceptionHandlers: Collection
get() = synchronized(lock) { platformExceptionHandlers_ }
private val platformExceptionHandlers_ = mutableSetOf()
internal actual fun ensurePlatformExceptionHandlerLoaded(callback: CoroutineExceptionHandler) {
synchronized(lock) {
platformExceptionHandlers_ += callback
}
}
@OptIn(ExperimentalStdlibApi::class)
internal actual fun propagateExceptionFinalResort(exception: Throwable) {
// log exception
processUnhandledException(exception)
}
internal actual class DiagnosticCoroutineContextException actual constructor(context: CoroutineContext) :
RuntimeException(context.toString())