Skip to content

Commit

Permalink
Comment on why s_createProcessLock exists in Process.Windows.cs (dotn…
Browse files Browse the repository at this point in the history
  • Loading branch information
stephentoub authored Dec 13, 2019
1 parent 8c878a0 commit 936f947
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,10 @@ private unsafe bool StartWithCreateProcess(ProcessStartInfo startInfo)
SafeFileHandle parentErrorPipeHandle = null;
SafeFileHandle childErrorPipeHandle = null;

// Take a global lock to synchronize all redirect pipe handle creations and CreateProcess
// calls. We do not want one process to inherit the handles created concurrently for another
// process, as that will impact the ownership and lifetimes of those handles now inherited
// into multiple child processes.
lock (s_createProcessLock)
{
try
Expand Down

0 comments on commit 936f947

Please sign in to comment.