Roman Elizarov | 1f74a2d | 2018-06-29 19:19:45 +0300 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. |
| 3 | */ |
| 4 | |
Vsevolod Tolstopyatov | 9619134 | 2018-04-20 18:13:33 +0300 | [diff] [blame] | 5 | package kotlinx.coroutines.experimental.internal |
| 6 | |
Roman Elizarov | 11d6b5b | 2018-04-26 10:11:50 +0300 | [diff] [blame] | 7 | internal actual typealias ReentrantLock = NoOpLock |
Vsevolod Tolstopyatov | 9619134 | 2018-04-20 18:13:33 +0300 | [diff] [blame] | 8 | |
Roman Elizarov | 11d6b5b | 2018-04-26 10:11:50 +0300 | [diff] [blame] | 9 | internal actual inline fun <T> ReentrantLock.withLock(action: () -> T) = action() |
Vsevolod Tolstopyatov | 9619134 | 2018-04-20 18:13:33 +0300 | [diff] [blame] | 10 | |
Roman Elizarov | 11d6b5b | 2018-04-26 10:11:50 +0300 | [diff] [blame] | 11 | internal class NoOpLock { |
Vsevolod Tolstopyatov | 9619134 | 2018-04-20 18:13:33 +0300 | [diff] [blame] | 12 | fun tryLock() = true |
| 13 | fun unlock(): Unit {} |
| 14 | } |
| 15 | |
Vsevolod Tolstopyatov | 167ca63 | 2018-06-29 11:49:00 +0300 | [diff] [blame] | 16 | internal actual fun <E> subscriberList(): SubscribersList<E> = CopyOnWriteList() |