diff --git a/src/OmniSharp.Cake/CachingScriptMetadataResolver.cs b/src/OmniSharp.Cake/CachingScriptMetadataResolver.cs index 67f2774891..583df1993f 100644 --- a/src/OmniSharp.Cake/CachingScriptMetadataResolver.cs +++ b/src/OmniSharp.Cake/CachingScriptMetadataResolver.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System.Collections.Concurrent; +using System.Collections.Generic; using System.Collections.Immutable; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Scripting; @@ -7,8 +8,8 @@ namespace OmniSharp.Cake { internal class CachingScriptMetadataResolver : MetadataReferenceResolver { - private static readonly Dictionary> DirectReferenceCache = new Dictionary>(); - private static readonly Dictionary MissingReferenceCache = new Dictionary(); + private static readonly ConcurrentDictionary> DirectReferenceCache = new ConcurrentDictionary>(); + private static readonly ConcurrentDictionary MissingReferenceCache = new ConcurrentDictionary(); private static readonly MetadataReferenceResolver DefaultRuntimeResolver = ScriptMetadataResolver.Default; public override bool Equals(object other) @@ -56,4 +57,4 @@ public override ImmutableArray ResolveReference(str return result; } } -} \ No newline at end of file +} diff --git a/src/OmniSharp.Script/CachingScriptMetadataResolver.cs b/src/OmniSharp.Script/CachingScriptMetadataResolver.cs index 5ff02eed44..12e092c63f 100644 --- a/src/OmniSharp.Script/CachingScriptMetadataResolver.cs +++ b/src/OmniSharp.Script/CachingScriptMetadataResolver.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Concurrent; using System.Collections.Immutable; using Microsoft.CodeAnalysis; @@ -7,8 +7,8 @@ namespace OmniSharp.Script public class CachingScriptMetadataResolver : MetadataReferenceResolver { private readonly MetadataReferenceResolver _defaultReferenceResolver; - private static Dictionary> DirectReferenceCache = new Dictionary>(); - private static Dictionary MissingReferenceCache = new Dictionary(); + private static ConcurrentDictionary> DirectReferenceCache = new ConcurrentDictionary>(); + private static ConcurrentDictionary MissingReferenceCache = new ConcurrentDictionary(); public CachingScriptMetadataResolver(MetadataReferenceResolver defaultReferenceResolver) {