From 56e222422b3ac49fdb7f6c89021094d76138f4a9 Mon Sep 17 00:00:00 2001 From: Paul Woitaschek Date: Wed, 2 Jun 2021 16:45:05 +0200 Subject: [PATCH] Mark the `ignoreRemainingEventsException` as `SharedImmutable` so it can be used from different threads on iOS. --- src/commonMain/kotlin/app/cash/turbine/FlowTurbine.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/commonMain/kotlin/app/cash/turbine/FlowTurbine.kt b/src/commonMain/kotlin/app/cash/turbine/FlowTurbine.kt index 5a4c3785..e4fa2ffb 100644 --- a/src/commonMain/kotlin/app/cash/turbine/FlowTurbine.kt +++ b/src/commonMain/kotlin/app/cash/turbine/FlowTurbine.kt @@ -15,6 +15,7 @@ */ package app.cash.turbine +import kotlin.native.concurrent.SharedImmutable import kotlin.time.Duration import kotlin.time.ExperimentalTime import kotlinx.coroutines.CancellationException @@ -177,6 +178,7 @@ public interface FlowTurbine { public suspend fun expectError(): Throwable } +@SharedImmutable private val ignoreRemainingEventsException = CancellationException("Ignore remaining events") public sealed class Event {