Skip to content

Commit f8bbbcc

Browse files
committed
Document process stdio handling
Add inline comments in GenerateCsWinRTStubExes.cs to clarify handling of stdout/stderr and the sequence of starting asynchronous reads (BeginOutputReadLine/BeginErrorReadLine) before waiting for process exit. Improves code readability by documenting intent around receiving stdio lines and blocking until completion.
1 parent fb7d3db commit f8bbbcc

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/WinRT.Generator.Tasks/GenerateCsWinRTStubExes.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,7 @@ private bool InvokeCompiler(string arguments, string workingDirectory, string st
695695
StringBuilder stdoutBuilder = new();
696696
StringBuilder stderrBuilder = new();
697697

698+
// Handle receiving stdio lines
698699
process.OutputDataReceived += (_, e) =>
699700
{
700701
if (e.Data is not null)
@@ -703,6 +704,7 @@ private bool InvokeCompiler(string arguments, string workingDirectory, string st
703704
}
704705
};
705706

707+
// Handle receiving stderr lines
706708
process.ErrorDataReceived += (_, e) =>
707709
{
708710
if (e.Data is not null)
@@ -711,6 +713,7 @@ private bool InvokeCompiler(string arguments, string workingDirectory, string st
711713
}
712714
};
713715

716+
// Start reading asynchronously and then block until the process completes
714717
process.BeginOutputReadLine();
715718
process.BeginErrorReadLine();
716719
process.WaitForExit();

0 commit comments

Comments
 (0)