Roman Elizarov | a7db8ec | 2017-12-21 22:45:12 +0300 | [diff] [blame] | 1 | /* |
Roman Elizarov | 1f74a2d | 2018-06-29 19:19:45 +0300 | [diff] [blame^] | 2 | * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. |
Roman Elizarov | a7db8ec | 2017-12-21 22:45:12 +0300 | [diff] [blame] | 3 | */ |
| 4 | |
Roman Elizarov | 65eff0b | 2017-12-20 15:51:31 +0300 | [diff] [blame] | 5 | package kotlinx.coroutines.experimental |
| 6 | |
Roman Elizarov | aa461cf | 2018-04-11 13:20:29 +0300 | [diff] [blame] | 7 | /** |
| 8 | * A runnable task for [CoroutineDispatcher.dispatch]. |
| 9 | */ |
| 10 | public actual typealias Runnable = java.lang.Runnable |
Roman Elizarov | 19f4845 | 2017-12-21 18:48:20 +0300 | [diff] [blame] | 11 | |
Roman Elizarov | aa461cf | 2018-04-11 13:20:29 +0300 | [diff] [blame] | 12 | /** |
| 13 | * Creates [Runnable] task instance. |
| 14 | */ |
| 15 | @Suppress("FunctionName") |
| 16 | public actual inline fun Runnable(crossinline block: () -> Unit): Runnable = |
| 17 | java.lang.Runnable { block() } |