···450450 Eio.Mutex.use_rw ~protect:true ep_pool.mutex (fun () ->
451451 ep_pool.stats.active <- ep_pool.stats.active + 1);
452452453453- (* Fork a daemon fiber to manage the connection lifecycle *)
454454- Eio.Fiber.fork_daemon ~sw (fun () ->
453453+ (* Fork a daemon fiber to manage the connection lifecycle.
454454+ Important: Fork under pool.sw, not the caller's sw, so the daemon
455455+ survives when the caller's switch ends and can return the connection
456456+ to the pool for reuse. *)
457457+ Eio.Fiber.fork_daemon ~sw:pool.sw (fun () ->
455458 Fun.protect
456459 ~finally:(fun () ->
457460 (* Decrement active count *)