Skip to content

Commit 0e0543d

Browse files
committed
Take a more conservative approach and roll back to only supporting share on 6.2
1 parent 2ab7f59 commit 0e0543d

File tree

2 files changed

+6
-31
lines changed

2 files changed

+6
-31
lines changed

Sources/AsyncAlgorithms/AsyncShareSequence.swift

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12+
#if compiler(>=6.2)
13+
1214
import Synchronization
1315
import DequeModule
1416

@@ -338,22 +340,15 @@ where Base.Element: Sendable, Base: AsyncSequenceSendableMetatype, Base.AsyncIte
338340
failure = error
339341
}
340342
}
341-
#if compiler(>=6.1)
343+
342344
let state: Mutex<State>
343-
#else
344-
let state: ManagedCriticalState<State>
345-
#endif
346345
let limit: Int?
347346

348347
init(
349348
_ iteratorFactory: @escaping @Sendable () -> sending Base.AsyncIterator,
350349
bufferingPolicy: AsyncBufferSequencePolicy
351350
) {
352-
#if compiler(>=6.1)
353351
state = Mutex(State(iteratorFactory, bufferingPolicy: bufferingPolicy))
354-
#else
355-
state = ManagedCriticalState(State(iteratorFactory, bufferingPolicy: bufferingPolicy))
356-
#endif
357352
switch bufferingPolicy.policy {
358353
case .bounded(let limit):
359354
self.limit = limit
@@ -644,7 +639,7 @@ where Base.Element: Sendable, Base: AsyncSequenceSendableMetatype, Base.AsyncIte
644639
// Using this priority escalation means that the base task can avoid being detached.
645640
//
646641
// This is disabled for now until the 9999 availability is removed from `withTaskPriorityEscalationHandler`
647-
#if false // TODO: replace with compiler(>=6.2)
642+
#if false // TODO: remove when this is resolved
648643
guard #available(macOS 26.0, iOS 26.0, tvOS 26.0, visionOS 26.0, *) else {
649644
return try await nextIteration(id).get()
650645
}
@@ -727,3 +722,5 @@ extension AsyncShareSequence: AsyncSequence {
727722
Iterator(extent.iteration)
728723
}
729724
}
725+
726+
#endif

Sources/AsyncAlgorithms/SendableMetatypes.swift

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)