@@ -273,13 +273,11 @@ public final class ConnectionPool<
273
273
274
274
public func run( ) async {
275
275
await withTaskCancellationHandler {
276
- #if os(Linux) || compiler(>=5.9)
277
276
if #available( macOS 14 . 0 , iOS 17 . 0 , tvOS 17 . 0 , watchOS 10 . 0 , * ) {
278
277
return await withDiscardingTaskGroup ( ) { taskGroup in
279
278
await self . run ( in: & taskGroup)
280
279
}
281
280
}
282
- #endif
283
281
return await withTaskGroup ( of: Void . self) { taskGroup in
284
282
await self . run ( in: & taskGroup)
285
283
}
@@ -313,14 +311,12 @@ public final class ConnectionPool<
313
311
case scheduleTimer( StateMachine . Timer )
314
312
}
315
313
316
- #if os(Linux) || compiler(>=5.9)
317
314
@available ( macOS 14 . 0 , iOS 17 . 0 , tvOS 17 . 0 , watchOS 10 . 0 , * )
318
315
private func run( in taskGroup: inout DiscardingTaskGroup ) async {
319
316
for await event in self . eventStream {
320
317
self . runEvent ( event, in: & taskGroup)
321
318
}
322
319
}
323
- #endif
324
320
325
321
private func run( in taskGroup: inout TaskGroup < Void > ) async {
326
322
var running = 0
@@ -507,11 +503,7 @@ public final class ConnectionPool<
507
503
await withTaskGroup ( of: TimerRunResult . self, returning: Void . self) { taskGroup in
508
504
taskGroup. addTask {
509
505
do {
510
- #if os(Linux) || compiler(>=5.9)
511
506
try await self . clock. sleep ( for: timer. duration)
512
- #else
513
- try await self . clock. sleep ( until: self . clock. now. advanced ( by: timer. duration) , tolerance: nil )
514
- #endif
515
507
return . timerTriggered
516
508
} catch {
517
509
return . timerCancelled
@@ -579,15 +571,13 @@ protocol TaskGroupProtocol {
579
571
mutating func addTask_( operation: @escaping @Sendable ( ) async -> Void )
580
572
}
581
573
582
- #if os(Linux) || swift(>=5.9)
583
574
@available ( macOS 14 . 0 , iOS 17 . 0 , tvOS 17 . 0 , watchOS 10 . 0 , * )
584
575
extension DiscardingTaskGroup : TaskGroupProtocol {
585
576
@inlinable
586
577
mutating func addTask_( operation: @escaping @Sendable ( ) async -> Void ) {
587
578
self . addTask ( priority: nil , operation: operation)
588
579
}
589
580
}
590
- #endif
591
581
592
582
extension TaskGroup < Void > : TaskGroupProtocol {
593
583
@inlinable
0 commit comments