Cleanup Sendable conformances and @preconcurrency imports to build as strict concurrency clean (#230)

This commit is contained in:
Philippe Hausler authored and GitHub committed 2022-11-16 10:15:26 -08:00
1 parent ae26222e86
commit 0174f58455
29 files changed
+46 -253

No files matched your search

@@ -9,7 +9,7 @@
//
//===----------------------------------------------------------------------===//
import OrderedCollections
@preconcurrency import OrderedCollections
/// An error-throwing channel for sending elements from on task to another with back pressure.
///
@@ -61,7 +61,7 @@ public final class AsyncThrowingChannel<Element: Sendable, Failure: Error>: Asyn
typealias Pending = ChannelToken<UnsafeContinuation<UnsafeContinuation<Element?, Error>?, Never>>
typealias Awaiting = ChannelToken<UnsafeContinuation<Element?, Error>>
struct ChannelToken<Continuation>: Hashable {
struct ChannelToken<Continuation: Sendable>: Hashable, Sendable {
var generation: Int
var continuation: Continuation?
@@ -95,14 +95,14 @@ public final class AsyncThrowingChannel<Element: Sendable, Failure: Error>: Asyn
case failed(Error)
}
enum Emission {
enum Emission: Sendable {
case idle
case pending(OrderedSet<Pending>)
case awaiting(OrderedSet<Awaiting>)
case terminated(Termination)
}
struct State {
struct State : Sendable {
var emission: Emission = .idle
var generation = 0
}