• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3  */
4 
5 package kotlinx.coroutines
6 
7 import kotlin.coroutines.*
8 
createEventLoopnull9 internal actual fun createEventLoop(): EventLoop = UnconfinedEventLoop()
10 
11 internal actual fun nanoTime(): Long = unsupported()
12 
13 internal class UnconfinedEventLoop : EventLoop() {
14     override fun dispatch(context: CoroutineContext, block: Runnable): Unit = unsupported()
15 }
16 
17 internal actual abstract class EventLoopImplPlatform : EventLoop() {
unparknull18     protected actual fun unpark(): Unit = unsupported()
19     protected actual fun reschedule(now: Long, delayedTask: EventLoopImplBase.DelayedTask): Unit = unsupported()
20 }
21 
22 internal actual object DefaultExecutor {
23     public actual fun enqueue(task: Runnable): Unit = unsupported()
24 }
25 
unsupportednull26 private fun unsupported(): Nothing =
27     throw UnsupportedOperationException("runBlocking event loop is not supported")
28 
29 internal actual inline fun platformAutoreleasePool(crossinline block: () -> Unit) = block()
30