Use a ConcurrentDictionary
This is used from a bunch of static methods. Dictionary isn't thread safe. Encountered this while debugging some other things.
This commit is contained in:
parent
9b4ec6ec71
commit
89bf58445f
|
|
@ -1,17 +1,17 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
using Microsoft.JSInterop;
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text.Json;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.JSInterop;
|
||||||
|
|
||||||
namespace BasicTestApp.InteropTest
|
namespace BasicTestApp.InteropTest
|
||||||
{
|
{
|
||||||
public class JavaScriptInterop
|
public class JavaScriptInterop
|
||||||
{
|
{
|
||||||
public static IDictionary<string, object[]> Invocations = new Dictionary<string, object[]>();
|
public static ConcurrentDictionary<string, object[]> Invocations = new ConcurrentDictionary<string, object[]>();
|
||||||
|
|
||||||
[JSInvokable]
|
[JSInvokable]
|
||||||
public static void ThrowException() => throw new InvalidOperationException("Threw an exception!");
|
public static void ThrowException() => throw new InvalidOperationException("Threw an exception!");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue