Fix thread safety issue that was causing intermittent build failures

This commit is contained in:
Steve Sanderson 2017-09-08 19:23:48 +01:00
parent dca24eb5cc
commit 5178efb17b
1 changed files with 20 additions and 2 deletions

View File

@ -56,9 +56,27 @@ namespace Templates.Test.Helpers
proc.BeginErrorReadLine();
}
public string Error => _stderrCapture.ToString();
public string Error
{
get
{
lock (_pipeCaptureLock)
{
return _stderrCapture.ToString();
}
}
}
public string Output => _stdoutCapture.ToString();
public string Output
{
get
{
lock (_pipeCaptureLock)
{
return _stdoutCapture.ToString();
}
}
}
public int ExitCode => _process.ExitCode;