blob: 2e23d5a7dca66f5428330ea2f2007f7be1aaad67 [file] [log] [blame]
Roman Elizarova7db8ec2017-12-21 22:45:12 +03001/*
Roman Elizarov1f74a2d2018-06-29 19:19:45 +03002 * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
Roman Elizarova7db8ec2017-12-21 22:45:12 +03003 */
4
Roman Elizarov65eff0b2017-12-20 15:51:31 +03005package kotlinx.coroutines.experimental
6
Roman Elizarovaa461cf2018-04-11 13:20:29 +03007/**
8 * A runnable task for [CoroutineDispatcher.dispatch].
9 */
10public actual typealias Runnable = java.lang.Runnable
Roman Elizarov19f48452017-12-21 18:48:20 +030011
Roman Elizarovaa461cf2018-04-11 13:20:29 +030012/**
13 * Creates [Runnable] task instance.
14 */
15@Suppress("FunctionName")
16public actual inline fun Runnable(crossinline block: () -> Unit): Runnable =
17 java.lang.Runnable { block() }