Skip to content

Commit 20a1026

Browse files
committed
Revert "AsyncBufferedChannel: use checked continuations"
1 parent ce02a35 commit 20a1026

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/AsyncChannels/AsyncBufferedChannel.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public final class AsyncBufferedChannel<Element>: AsyncSequence, Sendable {
3636

3737
struct Awaiting: Hashable {
3838
let id: Int
39-
let continuation: CheckedContinuation<Element?, Never>?
39+
let continuation: UnsafeContinuation<Element?, Never>?
4040

4141
static func placeHolder(id: Int) -> Awaiting {
4242
Awaiting(id: id, continuation: nil)
@@ -156,7 +156,7 @@ public final class AsyncBufferedChannel<Element>: AsyncSequence, Sendable {
156156
let cancellation = ManagedAtomic<Bool>(false)
157157

158158
return await withTaskCancellationHandler {
159-
await withCheckedContinuation { [state] (continuation: CheckedContinuation<Element?, Never>) in
159+
await withUnsafeContinuation { [state] (continuation: UnsafeContinuation<Element?, Never>) in
160160
let decision = state.withCriticalRegion { state -> AwaitingDecision in
161161
let isCancelled = cancellation.load(ordering: .acquiring)
162162
guard !isCancelled else { return .resume(nil) }

0 commit comments

Comments
 (0)