9
9
//
10
10
//===----------------------------------------------------------------------===//
11
11
12
+ #if compiler(>=6.2)
13
+
12
14
import Synchronization
13
15
import DequeModule
14
16
@@ -338,22 +340,15 @@ where Base.Element: Sendable, Base: AsyncSequenceSendableMetatype, Base.AsyncIte
338
340
failure = error
339
341
}
340
342
}
341
- #if compiler(>=6.1)
343
+
342
344
let state : Mutex < State >
343
- #else
344
- let state : ManagedCriticalState < State >
345
- #endif
346
345
let limit : Int ?
347
346
348
347
init (
349
348
_ iteratorFactory: @escaping @Sendable ( ) -> sending Base. AsyncIterator ,
350
349
bufferingPolicy: AsyncBufferSequencePolicy
351
350
) {
352
- #if compiler(>=6.1)
353
351
state = Mutex ( State ( iteratorFactory, bufferingPolicy: bufferingPolicy) )
354
- #else
355
- state = ManagedCriticalState ( State ( iteratorFactory, bufferingPolicy: bufferingPolicy) )
356
- #endif
357
352
switch bufferingPolicy. policy {
358
353
case . bounded( let limit) :
359
354
self . limit = limit
@@ -644,7 +639,7 @@ where Base.Element: Sendable, Base: AsyncSequenceSendableMetatype, Base.AsyncIte
644
639
// Using this priority escalation means that the base task can avoid being detached.
645
640
//
646
641
// 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
648
643
guard #available( macOS 26 . 0 , iOS 26 . 0 , tvOS 26 . 0 , visionOS 26 . 0 , * ) else {
649
644
return try await nextIteration ( id) . get ( )
650
645
}
@@ -727,3 +722,5 @@ extension AsyncShareSequence: AsyncSequence {
727
722
Iterator ( extent. iteration)
728
723
}
729
724
}
725
+
726
+ #endif
0 commit comments