[acceptance-tests] Fix a crash in the profiler stress runner caused by racey modifica...
authorAlex Rønne Petersen <alexrp@xamarin.com>
Sat, 22 Jul 2017 12:42:06 +0000 (14:42 +0200)
committerAlex Rønne Petersen <alexrp@xamarin.com>
Sat, 22 Jul 2017 12:42:06 +0000 (14:42 +0200)
acceptance-tests/profiler-stress/runner.cs

index ace091b42076b8b4e643130667ae3de92f4d544c..69ba9e5ab0a2cda0c8eb332b788c1cb22e77a77e 100644 (file)
@@ -152,12 +152,14 @@ namespace Mono.Profiling.Tests.Stress {
 
                                        proc.OutputDataReceived += (sender, args) => {
                                                if (args.Data != null)
-                                                       stdout.AppendLine (args.Data);
+                                                       lock (result)
+                                                               stdout.AppendLine (args.Data);
                                        };
 
                                        proc.ErrorDataReceived += (sender, args) => {
                                                if (args.Data != null)
-                                                       stderr.AppendLine (args.Data);
+                                                       lock (result)
+                                                               stderr.AppendLine (args.Data);
                                        };
 
                                        result.Stopwatch.Start ();