diff options
author | Alexis Christoforides <alexis@thenull.net> | 2020-04-08 23:06:37 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-08 23:06:37 +0300 |
commit | fda7280cea24a957fb58c0237e1e92d342d9998e (patch) | |
tree | 9ef962df4fb7b90a2eb40ac14cffa87d23252885 /mcs | |
parent | 1fa5c1e0ebe93a655be73f3cae4e56ab6032aa4b (diff) |
[merp] Synchronize (serialize) calls to MERP API (#19429)
Fixes https://github.com/mono/mono/issues/19406
Diffstat (limited to 'mcs')
-rw-r--r-- | mcs/class/corlib/Mono/Runtime.cs | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/mcs/class/corlib/Mono/Runtime.cs b/mcs/class/corlib/Mono/Runtime.cs index f59a7e93891..13f1bad8d31 100644 --- a/mcs/class/corlib/Mono/Runtime.cs +++ b/mcs/class/corlib/Mono/Runtime.cs @@ -81,7 +81,7 @@ namespace Mono { return true; } - static object exception_capture = new object (); + static object dump = new object (); [MethodImplAttribute (MethodImplOptions.InternalCall)] static extern string ExceptionToState_internal (Exception exc, out ulong portable_hash, out ulong unportable_hash); @@ -145,7 +145,7 @@ namespace Mono { { ulong portable_hash; ulong unportable_hash; - lock (exception_capture) + lock (dump) { string payload_str = ExceptionToState_internal (exc, out portable_hash, out unportable_hash); SendMicrosoftTelemetry (payload_str, portable_hash, unportable_hash); @@ -182,7 +182,11 @@ namespace Mono { { ulong portable_hash; ulong unportable_hash; - string payload_str = DumpStateSingle_internal (out portable_hash, out unportable_hash); + string payload_str; + lock (dump) + { + payload_str = DumpStateSingle_internal (out portable_hash, out unportable_hash); + } return new Tuple<String, ulong, ulong> (payload_str, portable_hash, unportable_hash); } @@ -192,7 +196,11 @@ namespace Mono { { ulong portable_hash; ulong unportable_hash; - string payload_str = DumpStateTotal_internal (out portable_hash, out unportable_hash); + string payload_str; + lock (dump) + { + payload_str = DumpStateTotal_internal (out portable_hash, out unportable_hash); + } return new Tuple<String, ulong, ulong> (payload_str, portable_hash, unportable_hash); } @@ -263,7 +271,10 @@ namespace Mono { using (var key_chars = RuntimeMarshal.MarshalString (key)) using (var val_chars = RuntimeMarshal.MarshalString (val)) { - AnnotateMicrosoftTelemetry_internal (key_chars.Value, val_chars.Value); + lock (dump) + { + AnnotateMicrosoftTelemetry_internal (key_chars.Value, val_chars.Value); + } } } } |