Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into issues/39928
  • Loading branch information
jeffhandley committed Jul 9, 2021
commit f72a1f67a0a317ffc487a204014006d52bed7a92
Original file line number Diff line number Diff line change
Expand Up @@ -1060,34 +1060,6 @@ private static int OnSigChild(int reapAll, int configureConsole)
}
}

/// <summary>
/// This method is called when the number of child processes that are using the terminal changes.
/// It updates the terminal configuration if necessary.
/// </summary>
internal static void ConfigureTerminalForChildProcesses(int increment)
{
Debug.Assert(increment != 0);

int childrenUsingTerminalRemaining = Interlocked.Add(ref s_childrenUsingTerminalCount, increment);
if (increment > 0)
{
Debug.Assert(s_processStartLock.IsReadLockHeld);

// At least one child is using the terminal.
Interop.Sys.ConfigureTerminalForChildProcess(childUsesTerminal: true);
}
else
{
Debug.Assert(s_processStartLock.IsWriteLockHeld);

if (childrenUsingTerminalRemaining == 0)
{
// No more children are using the terminal.
Interop.Sys.ConfigureTerminalForChildProcess(childUsesTerminal: false);
}
}
}

private static string GetErrorMessage(int error) => Interop.Sys.StrError(error);
}
}
You are viewing a condensed version of this merge commit. You can view the full changes here.