From 5a4d87dc7cf04bd567d88f0ff85f92f3a39d2d36 Mon Sep 17 00:00:00 2001 From: Easley Date: Wed, 13 May 2026 18:15:09 +0200 Subject: [PATCH] await output and error tasks concurrently via Task.WhenAll --- .../src/System/Diagnostics/Process.Multiplexing.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Multiplexing.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Multiplexing.cs index 6223af6cae0cb6..77ad161ac1496a 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Multiplexing.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Multiplexing.cs @@ -562,8 +562,7 @@ public async IAsyncEnumerable ReadAllLinesAsync([EnumeratorCa // Ensure both tasks complete before disposing the CancellationTokenSource. // The tasks handle all exceptions internally, so they always run to completion. - await outputTask.ConfigureAwait(false); - await errorTask.ConfigureAwait(false); + await Task.WhenAll(outputTask, errorTask).ConfigureAwait(false); linkedCts.Dispose(); }