1 /* 2 * Copyright 2016-2018 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 /** 8 * A runnable task for [CoroutineDispatcher.dispatch]. 9 */ 10 public actual interface Runnable { 11 /** 12 * @suppress 13 */ 14 public actual fun run() 15 } 16 17 /** 18 * Creates [Runnable] task instance. 19 */ 20 @Suppress("FunctionName") 21 public actual inline fun Runnable(crossinline block: () -> Unit): Runnable = 22 object : Runnable { 23 override fun run() { 24 block() 25 } 26 } 27