[acceptance-tests] Another attempt fix a StringBuilder race in the profiler stress...
[mono.git] / acceptance-tests / profiler-stress / runner.cs
index 05a1efb3514561a2f9f7d1bab68ed90695d27198..e5d44e68b4ac391c7ebd8a40d494e2ec202f56a1 100644 (file)
@@ -201,8 +201,10 @@ namespace Mono.Profiling.Tests.Stress {
 
                                        result.Stopwatch.Stop ();
 
-                                       result.StandardOutput = stdout.ToString ();
-                                       result.StandardError = stderr.ToString ();
+                                       lock (result) {
+                                               result.StandardOutput = stdout.ToString ();
+                                               result.StandardError = stderr.ToString ();
+                                       }
                                }
 
                                var resultStr = result.ExitCode == null ? "timed out" : $"exited with code: {result.ExitCode}";