@@ -273,13 +273,11 @@ public final class ConnectionPool<
273273
274274 public func run( ) async {
275275 await withTaskCancellationHandler {
276- #if os(Linux) || compiler(>=5.9)
277276 if #available( macOS 14 . 0 , iOS 17 . 0 , tvOS 17 . 0 , watchOS 10 . 0 , * ) {
278277 return await withDiscardingTaskGroup ( ) { taskGroup in
279278 await self . run ( in: & taskGroup)
280279 }
281280 }
282- #endif
283281 return await withTaskGroup ( of: Void . self) { taskGroup in
284282 await self . run ( in: & taskGroup)
285283 }
@@ -313,14 +311,12 @@ public final class ConnectionPool<
313311 case scheduleTimer( StateMachine . Timer )
314312 }
315313
316- #if os(Linux) || compiler(>=5.9)
317314 @available ( macOS 14 . 0 , iOS 17 . 0 , tvOS 17 . 0 , watchOS 10 . 0 , * )
318315 private func run( in taskGroup: inout DiscardingTaskGroup ) async {
319316 for await event in self . eventStream {
320317 self . runEvent ( event, in: & taskGroup)
321318 }
322319 }
323- #endif
324320
325321 private func run( in taskGroup: inout TaskGroup < Void > ) async {
326322 var running = 0
@@ -507,11 +503,7 @@ public final class ConnectionPool<
507503 await withTaskGroup ( of: TimerRunResult . self, returning: Void . self) { taskGroup in
508504 taskGroup. addTask {
509505 do {
510- #if os(Linux) || compiler(>=5.9)
511506 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
515507 return . timerTriggered
516508 } catch {
517509 return . timerCancelled
@@ -579,15 +571,13 @@ protocol TaskGroupProtocol {
579571 mutating func addTask_( operation: @escaping @Sendable ( ) async -> Void )
580572}
581573
582- #if os(Linux) || swift(>=5.9)
583574@available ( macOS 14 . 0 , iOS 17 . 0 , tvOS 17 . 0 , watchOS 10 . 0 , * )
584575extension DiscardingTaskGroup : TaskGroupProtocol {
585576 @inlinable
586577 mutating func addTask_( operation: @escaping @Sendable ( ) async -> Void ) {
587578 self . addTask ( priority: nil , operation: operation)
588579 }
589580}
590- #endif
591581
592582extension TaskGroup < Void > : TaskGroupProtocol {
593583 @inlinable
0 commit comments