Vsevolod Tolstopyatov | d57bfa2 | 2019-04-04 14:25:13 +0300 | [diff] [blame] | 1 | /* |
Aurimas Liutikas | 7b14046 | 2021-05-12 21:56:16 +0000 | [diff] [blame] | 2 | * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. |
Vsevolod Tolstopyatov | d57bfa2 | 2019-04-04 14:25:13 +0300 | [diff] [blame] | 3 | */ |
| 4 | |
| 5 | package kotlinx.coroutines.flow.internal |
| 6 | |
Roman Elizarov | 9b05908 | 2019-05-24 01:44:03 +0300 | [diff] [blame] | 7 | import kotlinx.coroutines.internal.* |
Vsevolod Tolstopyatov | c9f25fc | 2019-04-11 19:14:15 +0300 | [diff] [blame] | 8 | import kotlin.jvm.* |
Roman Elizarov | 60f8688 | 2019-12-17 19:14:52 +0300 | [diff] [blame] | 9 | import kotlin.native.concurrent.* |
Vsevolod Tolstopyatov | c9f25fc | 2019-04-11 19:14:15 +0300 | [diff] [blame] | 10 | |
Roman Elizarov | 9b05908 | 2019-05-24 01:44:03 +0300 | [diff] [blame] | 11 | /** |
| 12 | * This value is used a a surrogate `null` value when needed. |
| 13 | * It should never leak to the outside world. |
Vsevolod Tolstopyatov | 9587590 | 2020-10-20 02:40:38 -0700 | [diff] [blame] | 14 | * Its usage typically are paired with [Symbol.unbox] usages. |
Roman Elizarov | 9b05908 | 2019-05-24 01:44:03 +0300 | [diff] [blame] | 15 | */ |
| 16 | @JvmField |
| 17 | @SharedImmutable |
| 18 | internal val NULL = Symbol("NULL") |
Vsevolod Tolstopyatov | 4e47af4 | 2019-08-07 12:51:42 +0300 | [diff] [blame] | 19 | |
Vsevolod Tolstopyatov | 9587590 | 2020-10-20 02:40:38 -0700 | [diff] [blame] | 20 | /** |
| 21 | * Symbol to indicate that the value is not yet initialized. |
| 22 | * It should never leak to the outside world. |
| 23 | */ |
| 24 | @JvmField |
| 25 | @SharedImmutable |
| 26 | internal val UNINITIALIZED = Symbol("UNINITIALIZED") |
| 27 | |
Vsevolod Tolstopyatov | 4e47af4 | 2019-08-07 12:51:42 +0300 | [diff] [blame] | 28 | /* |
| 29 | * Symbol used to indicate that the flow is complete. |
| 30 | * It should never leak to the outside world. |
| 31 | */ |
| 32 | @JvmField |
| 33 | @SharedImmutable |
| 34 | internal val DONE = Symbol("DONE") |