Vsevolod Tolstopyatov | 79414ec | 2018-08-30 16:50:56 +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 | |
| 5 | package kotlinx.coroutines.experimental.internal |
| 6 | |
| 7 | import kotlinx.coroutines.experimental.* |
| 8 | import kotlin.coroutines.experimental.* |
| 9 | |
Roman Elizarov | ecbc85c | 2018-09-14 12:52:50 +0300 | [diff] [blame^] | 10 | /** |
| 11 | * This is a coroutine instance that is created by [coroutineScope] builder. |
| 12 | * It is just a vanilla instance of [AbstractCoroutine]. |
| 13 | */ |
| 14 | internal class ScopeCoroutine<R>( |
Vsevolod Tolstopyatov | 79414ec | 2018-08-30 16:50:56 +0300 | [diff] [blame] | 15 | parentContext: CoroutineContext |
Roman Elizarov | ecbc85c | 2018-09-14 12:52:50 +0300 | [diff] [blame^] | 16 | ) : AbstractCoroutine<R>(parentContext, true) |
Vsevolod Tolstopyatov | 79414ec | 2018-08-30 16:50:56 +0300 | [diff] [blame] | 17 | |
| 18 | internal class ContextScope(context: CoroutineContext) : CoroutineScope { |
| 19 | override val coroutineContext: CoroutineContext = context |
| 20 | } |