xref: /aosp_15_r20/external/kotlinx.coroutines/kotlinx-coroutines-core/nativeOther/test/Launcher.kt (revision 7a7160fed73afa6648ef8aa100d4a336fe921d9a)
1 package kotlinx.coroutines
2 
3 import kotlin.native.concurrent.*
4 import kotlin.native.internal.test.*
5 import kotlin.system.*
6 
7 // This is a separate entry point for tests in background
mainBackgroundnull8 fun mainBackground(args: Array<String>) {
9     val worker = Worker.start(name = "main-background")
10     worker.execute(TransferMode.SAFE, { args }) {
11         val result = testLauncherEntryPoint(it)
12         exitProcess(result)
13     }.result // block main thread
14 }
15