2 types derived from ConcurrentDictionary
Microsoft.AspNetCore.SignalR.Core (1)
System.Diagnostics.DiagnosticSource (1)
609 instantiations of ConcurrentDictionary
Aspire.Dashboard (6)
Aspire.Dashboard.Tests (1)
Aspire.Hosting (6)
Aspire.Hosting.Analyzers (1)
Aspire.Hosting.Tests (1)
Aspire.Microsoft.Data.SqlClient (1)
Aspire.Microsoft.EntityFrameworkCore.SqlServer (1)
Aspire.StackExchange.Redis (1)
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\StackExchangeRedisConnectionInstrumentation.cs (1)
31= new();
BasicTestApp (1)
DesignSurfaceExt (1)
dotnet-svcutil-lib (3)
HtmlGenerationWebSite (1)
InMemory.FunctionalTests (2)
JwtClientSample (1)
Microsoft.AspNetCore.App.Analyzers (2)
Microsoft.AspNetCore.Authorization.Policy (1)
Microsoft.AspNetCore.Components (14)
Microsoft.AspNetCore.Components.Authorization (1)
Microsoft.AspNetCore.Components.Endpoints (8)
Microsoft.AspNetCore.Components.Endpoints.Tests (1)
Binding\FormDataMapperTests.cs (1)
905var expected = new ConcurrentDictionary<int, int>(new Dictionary<int, int>() { [0] = 10, [1] = 11, [2] = 12, [3] = 13, [4] = 14, [5] = 15, [6] = 16, [7] = 17, [8] = 18, [9] = 19, });
Microsoft.AspNetCore.Components.Forms (4)
Microsoft.AspNetCore.Components.Forms.Tests (1)
Microsoft.AspNetCore.Components.QuickGrid (1)
Microsoft.AspNetCore.Components.Server (5)
Microsoft.AspNetCore.Components.Web (3)
Microsoft.AspNetCore.Components.WebAssembly (5)
Microsoft.AspNetCore.DataProtection (1)
Microsoft.AspNetCore.Diagnostics.Middleware (1)
Microsoft.AspNetCore.Grpc.JsonTranscoding (3)
Microsoft.AspNetCore.Grpc.Swagger (2)
Microsoft.AspNetCore.HeaderParsing (1)
Microsoft.AspNetCore.Http.Abstractions (4)
Microsoft.AspNetCore.Http.Connections (2)
Microsoft.AspNetCore.Http.Extensions (5)
Microsoft.AspNetCore.Mvc.Abstractions (3)
Microsoft.AspNetCore.Mvc.Core (15)
Microsoft.AspNetCore.Mvc.Formatters.Xml (4)
Microsoft.AspNetCore.Mvc.NewtonsoftJson (3)
Microsoft.AspNetCore.Mvc.Razor (4)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (1)
Microsoft.AspNetCore.Mvc.RazorPages (2)
Microsoft.AspNetCore.Mvc.TagHelpers (2)
Microsoft.AspNetCore.Mvc.TagHelpers.Test (4)
Microsoft.AspNetCore.Mvc.ViewFeatures (7)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (1)
Microsoft.AspNetCore.OpenApi (7)
Microsoft.AspNetCore.OutputCaching (1)
Microsoft.AspNetCore.Routing (4)
Microsoft.AspNetCore.Routing.Abstractions (2)
Microsoft.AspNetCore.Server.HttpSys (1)
Microsoft.AspNetCore.Server.Kestrel.Core (3)
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (1)
Microsoft.AspNetCore.Shared.Tests (2)
Microsoft.AspNetCore.SignalR.Client.Core (1)
Microsoft.AspNetCore.SignalR.Core (5)
Microsoft.AspNetCore.SignalR.StackExchangeRedis (3)
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (1)
Microsoft.AspNetCore.SignalR.Tests.Utils (1)
Microsoft.Build (55)
TypeLoader.cs (5)
34private static ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>> s_cacheOfLoadedTypesByFilter = new ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>>();
39private static ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>> s_cacheOfReflectionOnlyLoadedTypesByFilter = new ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>>();
246cache.GetOrAdd(_isDesiredType, (_) => new ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>());
314_typeNameToType = new(StringComparer.OrdinalIgnoreCase);
316_publicTypeNameToLoadedType = new(StringComparer.OrdinalIgnoreCase);
Microsoft.Build.Engine.OM.UnitTests (3)
Microsoft.Build.Engine.UnitTests (2)
Microsoft.Build.Framework (2)
Microsoft.Build.Tasks.Core (18)
RedistList.cs (5)
51private readonly ConcurrentDictionary<AssemblyNameExtension, bool> _assemblyNameInRedist = new ConcurrentDictionary<AssemblyNameExtension, bool>(AssemblyNameComparer.GenericComparer);
56private readonly ConcurrentDictionary<string, AssemblyEntry> _assemblyNameToUnifiedAssemblyName = new ConcurrentDictionary<string, AssemblyEntry>(StringComparer.OrdinalIgnoreCase);
61private readonly ConcurrentDictionary<string, AssemblyNameExtension> _assemblyNameToAssemblyNameExtension = new ConcurrentDictionary<string, AssemblyNameExtension>(StringComparer.OrdinalIgnoreCase);
67private readonly ConcurrentDictionary<AssemblyNameExtension, AssemblyNameExtension> _remappingCache = new ConcurrentDictionary<AssemblyNameExtension, AssemblyNameExtension>(AssemblyNameComparer.GenericComparerConsiderRetargetable);
70private readonly ConcurrentDictionary<string, Dictionary<string, string>> _cachedDenyList = new ConcurrentDictionary<string, Dictionary<string, string>>(StringComparer.OrdinalIgnoreCase);
Microsoft.Build.UnitTests.Shared (4)
Microsoft.Build.Utilities.Core (8)
Microsoft.CodeAnalysis (37)
CodeGen\PrivateImplementationDetails.cs (7)
68new ConcurrentDictionary<(ImmutableArray<byte> Data, ushort Alignment), MappedField>(DataAndUShortEqualityComparer.Instance);
72new ConcurrentDictionary<(ImmutableArray<byte> Data, ushort ElementType), CachedArrayField>(DataAndUShortEqualityComparer.Instance);
76new ConcurrentDictionary<(ImmutableArray<ConstantValue> Constants, ushort ElementType), CachedArrayField>(ConstantValueAndUShortEqualityComparer.Instance);
82private readonly ConcurrentDictionary<int, InstrumentationPayloadRootField> _instrumentationPayloadRootFields = new ConcurrentDictionary<int, InstrumentationPayloadRootField>();
87new ConcurrentDictionary<string, Cci.IMethodDefinition>();
91private readonly ConcurrentDictionary<string, Cci.INamespaceTypeDefinition> _synthesizedTopLevelTypes = new ConcurrentDictionary<string, Cci.INamespaceTypeDefinition>();
95private readonly ConcurrentDictionary<(uint Size, ushort Alignment), Cci.ITypeReference> _proxyTypes = new ConcurrentDictionary<(uint Size, ushort Alignment), Cci.ITypeReference>();
Emit\NoPia\EmbeddedTypesManager.cs (5)
70public readonly ConcurrentDictionary<TNamedTypeSymbol, TEmbeddedType> EmbeddedTypesMap = new ConcurrentDictionary<TNamedTypeSymbol, TEmbeddedType>(ReferenceEqualityComparer.Instance);
71public readonly ConcurrentDictionary<TFieldSymbol, TEmbeddedField> EmbeddedFieldsMap = new ConcurrentDictionary<TFieldSymbol, TEmbeddedField>(ReferenceEqualityComparer.Instance);
72public readonly ConcurrentDictionary<TMethodSymbol, TEmbeddedMethod> EmbeddedMethodsMap = new ConcurrentDictionary<TMethodSymbol, TEmbeddedMethod>(ReferenceEqualityComparer.Instance);
73public readonly ConcurrentDictionary<TPropertySymbol, TEmbeddedProperty> EmbeddedPropertiesMap = new ConcurrentDictionary<TPropertySymbol, TEmbeddedProperty>(ReferenceEqualityComparer.Instance);
74public readonly ConcurrentDictionary<TEventSymbol, TEmbeddedEvent> EmbeddedEventsMap = new ConcurrentDictionary<TEventSymbol, TEmbeddedEvent>(ReferenceEqualityComparer.Instance);
Microsoft.CodeAnalysis.CodeStyle (13)
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
Microsoft.CodeAnalysis.CSharp (28)
Symbols\Source\SourceAssemblySymbol.cs (4)
96private readonly ConcurrentDictionary<FieldSymbol, bool> _unassignedFieldsMap = new ConcurrentDictionary<FieldSymbol, bool>();
2163Interlocked.CompareExchange(ref _optimisticallyGrantedInternalsAccess, new ConcurrentDictionary<AssemblySymbol, bool>(), null);
2306new ConcurrentDictionary<string, ConcurrentDictionary<ImmutableArray<byte>, Tuple<Location, String>>>(StringComparer.OrdinalIgnoreCase), null);
2333keys = new ConcurrentDictionary<ImmutableArray<byte>, Tuple<Location, String>>();
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Features (3)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (1)
Microsoft.CodeAnalysis.EditorFeatures (1)
Microsoft.CodeAnalysis.EditorFeatures.Wpf (2)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (1)
Microsoft.CodeAnalysis.Features (16)
Microsoft.CodeAnalysis.LanguageServer (3)
Microsoft.CodeAnalysis.LanguageServer.Protocol (7)
Microsoft.CodeAnalysis.LanguageServer.UnitTests (1)
Microsoft.CodeAnalysis.Remote.ServiceHub (3)
Microsoft.CodeAnalysis.Remote.Workspaces (1)
Microsoft.CodeAnalysis.Test.Utilities (3)
Microsoft.CodeAnalysis.UnitTests (2)
Microsoft.CodeAnalysis.VisualBasic (23)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (1)
Microsoft.CodeAnalysis.Workspaces (19)
Workspace\Host\Documentation\DocumentationProviderServiceFactory.cs (1)
28new();
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (2)
Microsoft.CommonLanguageServerProtocol.Framework.Package (1)
Microsoft.CSharp (1)
Microsoft.DotNet.Build.Tasks.Packaging (1)
Microsoft.DotNet.XUnitAssert.Tests (4)
Microsoft.Extensions.Caching.Hybrid (2)
Microsoft.Extensions.Caching.Memory (1)
Microsoft.Extensions.DependencyInjection (6)
Microsoft.Extensions.DependencyInjection.Abstractions (1)
Microsoft.Extensions.Diagnostics.HealthChecks.Common (1)
Microsoft.Extensions.Diagnostics.Testing (2)
Microsoft.Extensions.FileProviders.Physical (3)
Microsoft.Extensions.Http (1)
Microsoft.Extensions.Http.Diagnostics (3)
Microsoft.Extensions.Http.Resilience (1)
Microsoft.Extensions.Localization (3)
Microsoft.Extensions.Logging (1)
Microsoft.Extensions.Logging.Abstractions (1)
Microsoft.Extensions.Logging.Console (2)
Microsoft.Extensions.Logging.TraceSource (1)
Microsoft.Extensions.ML (1)
Microsoft.Extensions.Options (1)
Microsoft.Extensions.ServiceDiscovery (2)
Microsoft.Extensions.Telemetry (3)
Microsoft.JSInterop (8)
Microsoft.Maui (9)
Microsoft.Maui.Controls (2)
Microsoft.ML.Core (3)
Microsoft.ML.Core.Tests (2)
Microsoft.ML.Data (1)
Microsoft.ML.Ensemble (1)
Microsoft.ML.FastTree (1)
Microsoft.ML.IntegrationTests (1)
Microsoft.ML.InternalCodeAnalyzer (2)
Microsoft.ML.Tokenizers (1)
Microsoft.NET.StringTools (1)
Microsoft.VisualStudio.LanguageServices (1)
Microsoft.VisualStudio.LanguageServices.DevKit (2)
Microsoft.VisualStudio.LanguageServices.Xaml (1)
MSBuild (8)
TypeLoader.cs (5)
34private static ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>> s_cacheOfLoadedTypesByFilter = new ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>>();
39private static ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>> s_cacheOfReflectionOnlyLoadedTypesByFilter = new ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>>();
246cache.GetOrAdd(_isDesiredType, (_) => new ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>());
314_typeNameToType = new(StringComparer.OrdinalIgnoreCase);
316_publicTypeNameToLoadedType = new(StringComparer.OrdinalIgnoreCase);
PresentationFramework (3)
Shared (2)
SignalRSamples (1)
SocialWeather (1)
System.ComponentModel.Annotations (4)
System\ComponentModel\DataAnnotations\AssociatedMetadataTypeTypeDescriptor.cs (3)
96private static readonly ConcurrentDictionary<Type, Type?> s_metadataTypeCache = new ConcurrentDictionary<Type, Type?>();
99private static readonly ConcurrentDictionary<(Type, string), Attribute[]> s_typeMemberCache = new ConcurrentDictionary<(Type, string), Attribute[]>();
102private static readonly ConcurrentDictionary<(Type, Type), bool> s_validatedMetadataTypeCache = new ConcurrentDictionary<(Type, Type), bool>();
System.ComponentModel.TypeConverter (4)
System.Data.Common (3)
System.Data.Odbc (3)
System.Diagnostics.DiagnosticSource (3)
System.Net.Http (2)
System.Net.Quic (1)
System.Net.Requests (1)
System.Net.Security (3)
System.Net.Sockets (1)
System.Private.DataContractSerialization (3)
System.Private.Windows.Core (1)
System.Private.Windows.Core.TestUtilities (1)
System.Reflection.MetadataLoadContext (8)
System\Reflection\TypeLoading\Modules\RoModule.Unifier.cs (5)
21private readonly ConcurrentDictionary<RoType, RoArrayType> _szArrayDict = new ConcurrentDictionary<RoType, RoArrayType>();
35private readonly ConcurrentDictionary<RoArrayType.Key, RoArrayType> _mdArrayDict = new ConcurrentDictionary<RoArrayType.Key, RoArrayType>();
48private readonly ConcurrentDictionary<RoType, RoByRefType> _byRefDict = new ConcurrentDictionary<RoType, RoByRefType>();
59private readonly ConcurrentDictionary<RoType, RoPointerType> _pointerDict = new ConcurrentDictionary<RoType, RoPointerType>();
70private readonly ConcurrentDictionary<RoConstructedGenericType.Key, RoConstructedGenericType> _constructedGenericTypeDict = new ConcurrentDictionary<RoConstructedGenericType.Key, RoConstructedGenericType>();
System.Resources.Extensions (1)
System.Runtime.InteropServices (1)
System.Runtime.Serialization.Formatters (2)
System.Security.Cryptography (6)
System.Text.Json (5)
System.Text.RegularExpressions (1)
System.Windows.Forms (3)
System.Xaml (2)
Templates.Blazor.Tests (1)
Templates.Blazor.WebAssembly.Auth.Tests (2)
Templates.Blazor.WebAssembly.Tests (2)
Templates.Mvc.Tests (2)
Templates.Tests (2)
TestContentPackage (1)
XmlFileLogger (3)
xunit.assert (4)
xunit.console (3)
1141 references to ConcurrentDictionary
Aspire.Dashboard (16)
Aspire.Dashboard.Tests (1)
Aspire.Hosting (15)
Dcp\ApplicationExecutor.cs (8)
107private readonly ConcurrentDictionary<string, Container> _containersMap = [];
108private readonly ConcurrentDictionary<string, Executable> _executablesMap = [];
109private readonly ConcurrentDictionary<string, Service> _servicesMap = [];
110private readonly ConcurrentDictionary<string, Endpoint> _endpointsMap = [];
111private readonly ConcurrentDictionary<(string, string), List<string>> _resourceAssociatedServicesMap = [];
112private readonly ConcurrentDictionary<string, (CancellationTokenSource Cancellation, Task Task)> _logStreams = new();
387private async Task ProcessResourceChange<T>(WatchEventType watchEventType, T resource, ConcurrentDictionary<string, T> resourceByName, string resourceKind, Func<T, CustomResourceSnapshot, CustomResourceSnapshot> snapshotFactory) where T : CustomResource
846private static bool ProcessResourceChange<T>(ConcurrentDictionary<string, T> map, WatchEventType watchEventType, T resource)
Aspire.Hosting.Analyzers (4)
Aspire.Hosting.Tests (1)
Aspire.Microsoft.Data.SqlClient (1)
Aspire.Microsoft.EntityFrameworkCore.SqlServer (1)
Aspire.StackExchange.Redis (1)
BasicTestApp (1)
DesignSurfaceExt (1)
dotnet-svcutil-lib (3)
HtmlGenerationWebSite (1)
InMemory.FunctionalTests (2)
JwtClientSample (1)
Microsoft.AspNetCore.App.Analyzers (5)
Microsoft.AspNetCore.Authorization.Policy (2)
Microsoft.AspNetCore.Components (14)
Microsoft.AspNetCore.Components.Authorization (1)
Microsoft.AspNetCore.Components.Endpoints (13)
Microsoft.AspNetCore.Components.Endpoints.Tests (3)
Binding\FormDataMapperTests.cs (3)
905var expected = new ConcurrentDictionary<int, int>(new Dictionary<int, int>() { [0] = 10, [1] = 11, [2] = 12, [3] = 13, [4] = 14, [5] = 15, [6] = 16, [7] = 17, [8] = 18, [9] = 19, });
906CanDeserialize_Dictionary<ConcurrentDictionary<int, int>, ConcurrentDictionary<int, int>, int, int>(expected);
Microsoft.AspNetCore.Components.Forms (5)
Microsoft.AspNetCore.Components.Forms.Tests (1)
Microsoft.AspNetCore.Components.QuickGrid (1)
Microsoft.AspNetCore.Components.Server (5)
Microsoft.AspNetCore.Components.Web (3)
Microsoft.AspNetCore.Components.WebAssembly (5)
Microsoft.AspNetCore.DataProtection (1)
Microsoft.AspNetCore.Diagnostics.Middleware (1)
Microsoft.AspNetCore.Grpc.JsonTranscoding (3)
Microsoft.AspNetCore.Grpc.Swagger (2)
Microsoft.AspNetCore.HeaderParsing (1)
Microsoft.AspNetCore.Http.Abstractions (7)
Microsoft.AspNetCore.Http.Connections (1)
Microsoft.AspNetCore.Http.Extensions (7)
Microsoft.AspNetCore.Mvc.Abstractions (3)
Microsoft.AspNetCore.Mvc.Core (18)
Microsoft.AspNetCore.Mvc.Formatters.Xml (4)
Microsoft.AspNetCore.Mvc.NewtonsoftJson (3)
Microsoft.AspNetCore.Mvc.Razor (5)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (1)
Microsoft.AspNetCore.Mvc.Razor.Test (1)
Microsoft.AspNetCore.Mvc.RazorPages (2)
Microsoft.AspNetCore.Mvc.TagHelpers (3)
Microsoft.AspNetCore.Mvc.TagHelpers.Test (4)
Microsoft.AspNetCore.Mvc.ViewFeatures (9)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (1)
Microsoft.AspNetCore.OpenApi (9)
Microsoft.AspNetCore.OutputCaching (1)
Microsoft.AspNetCore.Routing (9)
Microsoft.AspNetCore.Routing.Abstractions (5)
Microsoft.AspNetCore.Server.HttpSys (1)
Microsoft.AspNetCore.Server.Kestrel.Core (3)
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (1)
Microsoft.AspNetCore.Shared.Tests (5)
Microsoft.AspNetCore.SignalR.Client.Core (1)
Microsoft.AspNetCore.SignalR.Core (13)
DefaultHubLifetimeManager.cs (4)
147private static void SendToGroupConnections(string methodName, object?[] args, ConcurrentDictionary<string, HubConnectionContext> connections, Func<HubConnectionContext, object?, bool>? include, object? state, ref List<Task>? tasks, ref SerializedHubMessage? message, CancellationToken cancellationToken)
206var group = _groups[groupName];
238var group = _groups[groupName];
258var group = _groups[groupName];
Microsoft.AspNetCore.SignalR.StackExchangeRedis (3)
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (1)
Microsoft.AspNetCore.SignalR.Tests.Utils (1)
Microsoft.Build (92)
FileMatcher.cs (9)
42private static readonly Lazy<ConcurrentDictionary<string, IReadOnlyList<string>>> s_cachedGlobExpansions = new Lazy<ConcurrentDictionary<string, IReadOnlyList<string>>>(() => new ConcurrentDictionary<string, IReadOnlyList<string>>(StringComparer.OrdinalIgnoreCase));
43private static readonly Lazy<ConcurrentDictionary<string, object>> s_cachedGlobExpansionsLock = new Lazy<ConcurrentDictionary<string, object>>(() => new ConcurrentDictionary<string, object>(StringComparer.OrdinalIgnoreCase));
45private readonly ConcurrentDictionary<string, IReadOnlyList<string>> _cachedGlobExpansions;
46private readonly Lazy<ConcurrentDictionary<string, object>> _cachedGlobExpansionsLock = new Lazy<ConcurrentDictionary<string, object>>(() => new ConcurrentDictionary<string, object>(StringComparer.OrdinalIgnoreCase));
87public FileMatcher(IFileSystem fileSystem, ConcurrentDictionary<string, IReadOnlyList<string>> fileEntryExpansionCache = null) : this(
100internal FileMatcher(IFileSystem fileSystem, GetFileSystemEntries getFileSystemEntries, ConcurrentDictionary<string, IReadOnlyList<string>> getFileSystemDirectoryEntriesCache = null)
RegisteredTaskObjectCacheBase.cs (13)
25private static Lazy<ConcurrentDictionary<object, object>> s_appDomainLifetimeObjects = new Lazy<ConcurrentDictionary<object, object>>();
30private Lazy<ConcurrentDictionary<object, object>> _buildLifetimeObjects = new Lazy<ConcurrentDictionary<object, object>>();
61ConcurrentDictionary<object, object> dict = GetCollectionForLifetime(lifetime, dontCreate: false);
71ConcurrentDictionary<object, object> dict = GetCollectionForLifetime(lifetime, dontCreate: true);
83ConcurrentDictionary<object, object> dict = GetCollectionForLifetime(lifetime, dontCreate: true);
97var collection = GetCollectionForLifetime(lifetime, dontCreate: true);
104protected ConcurrentDictionary<object, object> GetCollectionForLifetime(RegisteredTaskObjectLifetime lifetime, bool dontCreate)
106Lazy<ConcurrentDictionary<object, object>> dict = GetLazyCollectionForLifetime(lifetime);
120protected Lazy<ConcurrentDictionary<object, object>> GetLazyCollectionForLifetime(RegisteredTaskObjectLifetime lifetime)
122Lazy<ConcurrentDictionary<object, object>> dict = null;
140private static void DisposeObjects(Lazy<ConcurrentDictionary<object, object>> lifetimeObjects)
TypeLoader.cs (11)
34private static ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>> s_cacheOfLoadedTypesByFilter = new ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>>();
39private static ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>> s_cacheOfReflectionOnlyLoadedTypesByFilter = new ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>>();
241private LoadedType GetLoadedType(ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>> cache, string typeName, AssemblyLoadInfo assembly, bool useTaskHost)
245ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes> loadInfoToType =
283private ConcurrentDictionary<string, Type> _typeNameToType;
290private ConcurrentDictionary<string, LoadedType> _publicTypeNameToLoadedType;
Microsoft.Build.Engine.OM.UnitTests (3)
Microsoft.Build.Engine.UnitTests (1)
Microsoft.Build.Framework (3)
Microsoft.Build.Tasks.Core (36)
AssemblyDependency\ResolveAssemblyReference.cs (3)
2371ConcurrentDictionary<string, AssemblyMetadata> assemblyMetadataCache =
2678private AssemblyNameExtension[] GetDependencies(Reference resolvedReference, FileExists fileExists, GetAssemblyMetadata getAssemblyMetadata, ConcurrentDictionary<string, AssemblyMetadata> assemblyMetadataCache)
3214(string path, ConcurrentDictionary<string, AssemblyMetadata> assemblyMetadataCache, out AssemblyNameExtension[] dependencies, out string[] scatterFiles, out FrameworkNameVersioning frameworkName)
FileMatcher.cs (9)
42private static readonly Lazy<ConcurrentDictionary<string, IReadOnlyList<string>>> s_cachedGlobExpansions = new Lazy<ConcurrentDictionary<string, IReadOnlyList<string>>>(() => new ConcurrentDictionary<string, IReadOnlyList<string>>(StringComparer.OrdinalIgnoreCase));
43private static readonly Lazy<ConcurrentDictionary<string, object>> s_cachedGlobExpansionsLock = new Lazy<ConcurrentDictionary<string, object>>(() => new ConcurrentDictionary<string, object>(StringComparer.OrdinalIgnoreCase));
45private readonly ConcurrentDictionary<string, IReadOnlyList<string>> _cachedGlobExpansions;
46private readonly Lazy<ConcurrentDictionary<string, object>> _cachedGlobExpansionsLock = new Lazy<ConcurrentDictionary<string, object>>(() => new ConcurrentDictionary<string, object>(StringComparer.OrdinalIgnoreCase));
87public FileMatcher(IFileSystem fileSystem, ConcurrentDictionary<string, IReadOnlyList<string>> fileEntryExpansionCache = null) : this(
100internal FileMatcher(IFileSystem fileSystem, GetFileSystemEntries getFileSystemEntries, ConcurrentDictionary<string, IReadOnlyList<string>> getFileSystemDirectoryEntriesCache = null)
GetSDKReferenceFiles.cs (8)
54private readonly ConcurrentDictionary<string, SDKInfo> _cacheFileForSDKs = new ConcurrentDictionary<string, SDKInfo>(StringComparer.OrdinalIgnoreCase);
995var references = new ConcurrentDictionary<string, SdkReferenceInfo>(StringComparer.OrdinalIgnoreCase);
996var directoryToFileList = new ConcurrentDictionary<string, List<string>>(StringComparer.OrdinalIgnoreCase);
1025private void PopulateReferencesDictionaryFromManifestPaths(ConcurrentDictionary<string, List<string>> referencesByDirectory, ConcurrentDictionary<string, SdkReferenceInfo> references, string[] sdkManifestReferences)
1043private void PopulateReferencesDictionaryFromPaths(ConcurrentDictionary<string, List<string>> referencesByDirectory, ConcurrentDictionary<string, SdkReferenceInfo> references, IEnumerable<string> referenceDirectories)
1060private static void PopulateRedistDictionaryFromPaths(ConcurrentDictionary<string, List<string>> redistFilesByDirectory, IEnumerable<string> redistDirectories)
RedistList.cs (5)
51private readonly ConcurrentDictionary<AssemblyNameExtension, bool> _assemblyNameInRedist = new ConcurrentDictionary<AssemblyNameExtension, bool>(AssemblyNameComparer.GenericComparer);
56private readonly ConcurrentDictionary<string, AssemblyEntry> _assemblyNameToUnifiedAssemblyName = new ConcurrentDictionary<string, AssemblyEntry>(StringComparer.OrdinalIgnoreCase);
61private readonly ConcurrentDictionary<string, AssemblyNameExtension> _assemblyNameToAssemblyNameExtension = new ConcurrentDictionary<string, AssemblyNameExtension>(StringComparer.OrdinalIgnoreCase);
67private readonly ConcurrentDictionary<AssemblyNameExtension, AssemblyNameExtension> _remappingCache = new ConcurrentDictionary<AssemblyNameExtension, AssemblyNameExtension>(AssemblyNameComparer.GenericComparerConsiderRetargetable);
70private readonly ConcurrentDictionary<string, Dictionary<string, string>> _cachedDenyList = new ConcurrentDictionary<string, Dictionary<string, string>>(StringComparer.OrdinalIgnoreCase);
Microsoft.Build.Tasks.UnitTests (1)
Microsoft.Build.UnitTests.Shared (4)
Microsoft.Build.Utilities.Core (14)
FileMatcher.cs (9)
42private static readonly Lazy<ConcurrentDictionary<string, IReadOnlyList<string>>> s_cachedGlobExpansions = new Lazy<ConcurrentDictionary<string, IReadOnlyList<string>>>(() => new ConcurrentDictionary<string, IReadOnlyList<string>>(StringComparer.OrdinalIgnoreCase));
43private static readonly Lazy<ConcurrentDictionary<string, object>> s_cachedGlobExpansionsLock = new Lazy<ConcurrentDictionary<string, object>>(() => new ConcurrentDictionary<string, object>(StringComparer.OrdinalIgnoreCase));
45private readonly ConcurrentDictionary<string, IReadOnlyList<string>> _cachedGlobExpansions;
46private readonly Lazy<ConcurrentDictionary<string, object>> _cachedGlobExpansionsLock = new Lazy<ConcurrentDictionary<string, object>>(() => new ConcurrentDictionary<string, object>(StringComparer.OrdinalIgnoreCase));
87public FileMatcher(IFileSystem fileSystem, ConcurrentDictionary<string, IReadOnlyList<string>> fileEntryExpansionCache = null) : this(
100internal FileMatcher(IFileSystem fileSystem, GetFileSystemEntries getFileSystemEntries, ConcurrentDictionary<string, IReadOnlyList<string>> getFileSystemDirectoryEntriesCache = null)
Microsoft.CodeAnalysis (62)
CodeGen\PrivateImplementationDetails.cs (7)
67private readonly ConcurrentDictionary<(ImmutableArray<byte> Data, ushort Alignment), MappedField> _mappedFields =
71private readonly ConcurrentDictionary<(ImmutableArray<byte> Data, ushort ElementType), CachedArrayField> _cachedArrayFields =
75private readonly ConcurrentDictionary<(ImmutableArray<ConstantValue> Constants, ushort ElementType), CachedArrayField> _cachedArrayFieldsForConstants =
82private readonly ConcurrentDictionary<int, InstrumentationPayloadRootField> _instrumentationPayloadRootFields = new ConcurrentDictionary<int, InstrumentationPayloadRootField>();
86private readonly ConcurrentDictionary<string, Cci.IMethodDefinition> _synthesizedMethods =
91private readonly ConcurrentDictionary<string, Cci.INamespaceTypeDefinition> _synthesizedTopLevelTypes = new ConcurrentDictionary<string, Cci.INamespaceTypeDefinition>();
95private readonly ConcurrentDictionary<(uint Size, ushort Alignment), Cci.ITypeReference> _proxyTypes = new ConcurrentDictionary<(uint Size, ushort Alignment), Cci.ITypeReference>();
Collections\CachingDictionary.cs (7)
128private ConcurrentDictionary<TKey, ImmutableArray<TElement>> CreateConcurrentDictionary()
149ConcurrentDictionary<TKey, ImmutableArray<TElement>>? concurrentMap;
173concurrentMap = localMap as ConcurrentDictionary<TKey, ImmutableArray<TElement>>;
185private ImmutableArray<TElement> AddToConcurrentMap(ConcurrentDictionary<TKey, ImmutableArray<TElement>> map, TKey key)
206return existingMap == null || existingMap is ConcurrentDictionary<TKey, ImmutableArray<TElement>>;
214private IDictionary<TKey, ImmutableArray<TElement>> CreateFullyPopulatedMap(ConcurrentDictionary<TKey, ImmutableArray<TElement>>? existingMap)
254IDictionary<TKey, ImmutableArray<TElement>> fullyPopulatedMap = CreateFullyPopulatedMap((ConcurrentDictionary<TKey, ImmutableArray<TElement>>?)currentMap);
DiagnosticAnalyzer\AnalyzerDriver.cs (9)
108private ConcurrentDictionary<(INamespaceOrTypeSymbol, DiagnosticAnalyzer), IGroupedAnalyzerActions>? _lazyPerSymbolAnalyzerActionsCache;
116private ConcurrentDictionary<(INamespaceOrTypeSymbol, DiagnosticAnalyzer), IGroupedAnalyzerActions> PerSymbolAnalyzerActionsCache
233private ConcurrentDictionary<SyntaxTree, bool>? _lazyGeneratedCodeFilesMap;
238private ConcurrentDictionary<SyntaxTree, bool> GeneratedCodeFilesMap
261private ConcurrentDictionary<SyntaxTree, ImmutableHashSet<DiagnosticAnalyzer>>? _lazySuppressedAnalyzersForTreeMap;
266private ConcurrentDictionary<SyntaxTree, ImmutableHashSet<DiagnosticAnalyzer>> SuppressedAnalyzersForTreeMap
291private ConcurrentDictionary<ISymbol, bool>? _lazyIsGeneratedCodeSymbolMap;
296private ConcurrentDictionary<ISymbol, bool> IsGeneratedCodeSymbolMap
308private ConcurrentDictionary<SyntaxTree, bool>? _lazyTreesWithHiddenRegionsMap;
Emit\NoPia\EmbeddedTypesManager.cs (5)
70public readonly ConcurrentDictionary<TNamedTypeSymbol, TEmbeddedType> EmbeddedTypesMap = new ConcurrentDictionary<TNamedTypeSymbol, TEmbeddedType>(ReferenceEqualityComparer.Instance);
71public readonly ConcurrentDictionary<TFieldSymbol, TEmbeddedField> EmbeddedFieldsMap = new ConcurrentDictionary<TFieldSymbol, TEmbeddedField>(ReferenceEqualityComparer.Instance);
72public readonly ConcurrentDictionary<TMethodSymbol, TEmbeddedMethod> EmbeddedMethodsMap = new ConcurrentDictionary<TMethodSymbol, TEmbeddedMethod>(ReferenceEqualityComparer.Instance);
73public readonly ConcurrentDictionary<TPropertySymbol, TEmbeddedProperty> EmbeddedPropertiesMap = new ConcurrentDictionary<TPropertySymbol, TEmbeddedProperty>(ReferenceEqualityComparer.Instance);
74public readonly ConcurrentDictionary<TEventSymbol, TEmbeddedEvent> EmbeddedEventsMap = new ConcurrentDictionary<TEventSymbol, TEmbeddedEvent>(ReferenceEqualityComparer.Instance);
InternalUtilities\ConcurrentDictionaryExtensions.cs (3)
19public static void Add<K, V>(this ConcurrentDictionary<K, V> dict, K key, V value)
28public static TValue GetOrAdd<TKey, TArg, TValue>(this ConcurrentDictionary<TKey, TValue> dictionary, TKey key, Func<TKey, TArg, TValue> valueFactory, TArg factoryArgument)
45this ConcurrentDictionary<TKey, TValue> dictionary,
Microsoft.CodeAnalysis.CodeStyle (46)
src\Analyzers\Core\Analyzers\IDEDiagnosticIdToOptionMappingHelper.cs (7)
23private static readonly ConcurrentDictionary<string, ImmutableHashSet<IOption2>> s_diagnosticIdToOptionMap = new();
24private static readonly ConcurrentDictionary<string, ConcurrentDictionary<string, ImmutableHashSet<IOption2>>> s_diagnosticIdToLanguageSpecificOptionsMap = new();
25private static readonly ConcurrentDictionary<string, PerLanguageOption2<bool>> s_diagnosticIdToFadingOptionMap = new();
29(s_diagnosticIdToLanguageSpecificOptionsMap.TryGetValue(language, out var map) &&
71var map = s_diagnosticIdToLanguageSpecificOptionsMap.GetOrAdd(language, _ => new ConcurrentDictionary<string, ImmutableHashSet<IOption2>>());
84private static void AddOptionMapping(ConcurrentDictionary<string, ImmutableHashSet<IOption2>> map, string diagnosticId, ImmutableHashSet<IOption2> options)
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (12)
46private static readonly ObjectPool<ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>>> s_fieldToUsageLocationPool = new(() => []);
63protected static void AddFieldUsage(ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> fieldWrites, IFieldSymbol field, SyntaxNode location)
66private static void ClearAndFree(ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> multiMap)
103HashSet<string> fieldNames, ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> ineligibleFieldUsageIfOutsideProperty, SemanticModel semanticModel, SyntaxNode codeBlock, CancellationToken cancellationToken);
118var ineligibleFieldUsageIfOutsideProperty = s_fieldToUsageLocationPool.Allocate();
123var fieldReads = s_fieldToUsageLocationPool.Allocate();
124var fieldWrites = s_fieldToUsageLocationPool.Allocate();
229ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> fieldReads,
230ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> fieldWrites,
539ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> ineligibleFieldUsageIfOutsideProperty,
540ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> fieldReads,
541ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> fieldWrites,
src\Compilers\Core\Portable\InternalUtilities\ConcurrentDictionaryExtensions.cs (3)
19public static void Add<K, V>(this ConcurrentDictionary<K, V> dict, K key, V value)
28public static TValue GetOrAdd<TKey, TArg, TValue>(this ConcurrentDictionary<TKey, TValue> dictionary, TKey key, Func<TKey, TArg, TValue> valueFactory, TArg factoryArgument)
45this ConcurrentDictionary<TKey, TValue> dictionary,
Microsoft.CodeAnalysis.CodeStyle.Fixes (4)
Microsoft.CodeAnalysis.CSharp (60)
Symbols\Source\SourceAssemblySymbol.cs (11)
96private readonly ConcurrentDictionary<FieldSymbol, bool> _unassignedFieldsMap = new ConcurrentDictionary<FieldSymbol, bool>();
532private ConcurrentDictionary<AssemblySymbol, bool> _optimisticallyGrantedInternalsAccess;
737foreach (var keys in _lazyInternalsVisibleToMap.Values)
2099ConcurrentDictionary<AssemblySymbol, bool> haveGrantedAssemblies = _optimisticallyGrantedInternalsAccess;
2130ConcurrentDictionary<ImmutableArray<byte>, Tuple<Location, string>> result = null;
2194private ConcurrentDictionary<string, ConcurrentDictionary<ImmutableArray<byte>, Tuple<Location, string>>> _lazyInternalsVisibleToMap;
2272ref ConcurrentDictionary<string, ConcurrentDictionary<ImmutableArray<byte>, Tuple<Location, string>>> lazyInternalsVisibleToMap)
2306new ConcurrentDictionary<string, ConcurrentDictionary<ImmutableArray<byte>, Tuple<Location, String>>>(StringComparer.OrdinalIgnoreCase), null);
2326ConcurrentDictionary<ImmutableArray<byte>, Tuple<Location, string>> keys = null;
Microsoft.CodeAnalysis.CSharp.CodeStyle (8)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Features (8)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
Microsoft.CodeAnalysis.EditorFeatures (2)
Microsoft.CodeAnalysis.EditorFeatures.Wpf (3)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (1)
Microsoft.CodeAnalysis.ExternalAccess.Copilot (1)
Microsoft.CodeAnalysis.Features (60)
AddImport\AbstractAddImportFeatureService.cs (6)
145var projectToAssembly = new ConcurrentDictionary<Project, AsyncLazy<IAssemblySymbol>>(concurrencyLevel: 2, capacity: project.Solution.ProjectIds.Count);
146var referenceToCompilation = new ConcurrentDictionary<PortableExecutableReference, Compilation>(concurrencyLevel: 2, capacity: project.Solution.Projects.Sum(p => p.MetadataReferences.Count));
170ConcurrentDictionary<Project, AsyncLazy<IAssemblySymbol>> projectToAssembly,
171ConcurrentDictionary<PortableExecutableReference, Compilation> referenceToCompilation,
215ConcurrentDictionary<Project, AsyncLazy<IAssemblySymbol>> projectToAssembly,
260ConcurrentDictionary<PortableExecutableReference, Compilation> referenceToCompilation,
src\Analyzers\Core\Analyzers\IDEDiagnosticIdToOptionMappingHelper.cs (7)
23private static readonly ConcurrentDictionary<string, ImmutableHashSet<IOption2>> s_diagnosticIdToOptionMap = new();
24private static readonly ConcurrentDictionary<string, ConcurrentDictionary<string, ImmutableHashSet<IOption2>>> s_diagnosticIdToLanguageSpecificOptionsMap = new();
25private static readonly ConcurrentDictionary<string, PerLanguageOption2<bool>> s_diagnosticIdToFadingOptionMap = new();
29(s_diagnosticIdToLanguageSpecificOptionsMap.TryGetValue(language, out var map) &&
71var map = s_diagnosticIdToLanguageSpecificOptionsMap.GetOrAdd(language, _ => new ConcurrentDictionary<string, ImmutableHashSet<IOption2>>());
84private static void AddOptionMapping(ConcurrentDictionary<string, ImmutableHashSet<IOption2>> map, string diagnosticId, ImmutableHashSet<IOption2> options)
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (9)
46private static readonly ObjectPool<ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>>> s_fieldToUsageLocationPool = new(() => []);
63protected static void AddFieldUsage(ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> fieldWrites, IFieldSymbol field, SyntaxNode location)
66private static void ClearAndFree(ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> multiMap)
103HashSet<string> fieldNames, ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> ineligibleFieldUsageIfOutsideProperty, SemanticModel semanticModel, SyntaxNode codeBlock, CancellationToken cancellationToken);
229ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> fieldReads,
230ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> fieldWrites,
539ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> ineligibleFieldUsageIfOutsideProperty,
540ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> fieldReads,
541ConcurrentDictionary<IFieldSymbol, ConcurrentSet<SyntaxNode>> fieldWrites,
Microsoft.CodeAnalysis.LanguageServer (6)
Microsoft.CodeAnalysis.LanguageServer.Protocol (18)
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\RequestExecutionQueue.cs (4)
197var concurrentlyExecutingTasks = new ConcurrentDictionary<Task, CancellationTokenSource>();
301/// Reflection invokes <see cref="ProcessQueueCoreAsync{TRequest, TResponse}(IQueueItem{TRequestContext}, IMethodHandler, RequestHandlerMetadata, ConcurrentDictionary{Task, CancellationTokenSource}, CancellationTokenSource?, CancellationToken)"/>
309ConcurrentDictionary<Task, CancellationTokenSource> concurrentlyExecutingTasks,
331ConcurrentDictionary<Task, CancellationTokenSource> concurrentlyExecutingTasks,
Microsoft.CodeAnalysis.LanguageServer.UnitTests (1)
Microsoft.CodeAnalysis.Remote.ServiceHub (5)
Microsoft.CodeAnalysis.Remote.Workspaces (1)
Microsoft.CodeAnalysis.Test.Utilities (3)
Microsoft.CodeAnalysis.UnitTests (2)
Microsoft.CodeAnalysis.VisualBasic (31)
Symbols\Source\SourceAssemblySymbol.vb (7)
74Private _lazyInternalsVisibleToMap As ConcurrentDictionary(Of String, ConcurrentDictionary(Of ImmutableArray(Of Byte), Tuple(Of Location, String)))
874Private _optimisticallyGrantedInternalsAccess As ConcurrentDictionary(Of AssemblySymbol, Boolean)
880Dim haveGrantedAssemblies As ConcurrentDictionary(Of AssemblySymbol, Boolean) = _optimisticallyGrantedInternalsAccess
914Dim result As ConcurrentDictionary(Of ImmutableArray(Of Byte), Tuple(Of Location, String)) = Nothing
984New ConcurrentDictionary(Of String, ConcurrentDictionary(Of ImmutableArray(Of Byte), Tuple(Of Location, String)))(StringComparer.OrdinalIgnoreCase), Nothing)
1003Dim keys As ConcurrentDictionary(Of ImmutableArray(Of Byte), Tuple(Of Location, String)) = Nothing
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (1)
Microsoft.CodeAnalysis.VisualBasic.Features (1)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (3)
Microsoft.CodeAnalysis.Workspaces (42)
src\Compilers\Core\Portable\InternalUtilities\ConcurrentDictionaryExtensions.cs (3)
19public static void Add<K, V>(this ConcurrentDictionary<K, V> dict, K key, V value)
28public static TValue GetOrAdd<TKey, TArg, TValue>(this ConcurrentDictionary<TKey, TValue> dictionary, TKey key, Func<TKey, TArg, TValue> valueFactory, TArg factoryArgument)
45this ConcurrentDictionary<TKey, TValue> dictionary,
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (7)
src\Compilers\Core\Portable\InternalUtilities\ConcurrentDictionaryExtensions.cs (3)
19public static void Add<K, V>(this ConcurrentDictionary<K, V> dict, K key, V value)
28public static TValue GetOrAdd<TKey, TArg, TValue>(this ConcurrentDictionary<TKey, TValue> dictionary, TKey key, Func<TKey, TArg, TValue> valueFactory, TArg factoryArgument)
45this ConcurrentDictionary<TKey, TValue> dictionary,
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (1)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (6)
Microsoft.CommonLanguageServerProtocol.Framework.Package (6)
RequestExecutionQueue.cs (4)
197var concurrentlyExecutingTasks = new ConcurrentDictionary<Task, CancellationTokenSource>();
301/// Reflection invokes <see cref="ProcessQueueCoreAsync{TRequest, TResponse}(IQueueItem{TRequestContext}, IMethodHandler, RequestHandlerMetadata, ConcurrentDictionary{Task, CancellationTokenSource}, CancellationTokenSource?, CancellationToken)"/>
309ConcurrentDictionary<Task, CancellationTokenSource> concurrentlyExecutingTasks,
331ConcurrentDictionary<Task, CancellationTokenSource> concurrentlyExecutingTasks,
Microsoft.CSharp (1)
Microsoft.DotNet.Build.Tasks.Packaging (1)
Microsoft.DotNet.XUnitAssert.Tests (4)
Microsoft.Extensions.Caching.Hybrid (2)
Microsoft.Extensions.Caching.Memory (1)
Microsoft.Extensions.DependencyInjection (6)
Microsoft.Extensions.DependencyInjection.Abstractions (1)
Microsoft.Extensions.Diagnostics.HealthChecks.Common (1)
Microsoft.Extensions.Diagnostics.Testing (2)
Microsoft.Extensions.FileProviders.Physical (5)
Microsoft.Extensions.Http (1)
Microsoft.Extensions.Http.Diagnostics (3)
Microsoft.Extensions.Http.Resilience (1)
Microsoft.Extensions.Localization (4)
Microsoft.Extensions.Logging (1)
Microsoft.Extensions.Logging.Abstractions (1)
Microsoft.Extensions.Logging.Console (3)
Microsoft.Extensions.Logging.TraceSource (1)
Microsoft.Extensions.ML (1)
Microsoft.Extensions.Options (1)
Microsoft.Extensions.Resilience (2)
Microsoft.Extensions.ServiceDiscovery (2)
Microsoft.Extensions.Telemetry (5)
Microsoft.JSInterop (8)
Microsoft.Maui (11)
Microsoft.Maui.Controls (2)
Microsoft.ML.Core (3)
Microsoft.ML.Core.Tests (2)
Microsoft.ML.Data (1)
Microsoft.ML.Ensemble (7)
Microsoft.ML.FastTree (1)
Microsoft.ML.IntegrationTests (1)
Microsoft.ML.InternalCodeAnalyzer (4)
Microsoft.ML.Tokenizers (1)
Microsoft.NET.StringTools (1)
Microsoft.VisualStudio.LanguageServices (6)
Microsoft.VisualStudio.LanguageServices.DevKit (4)
Microsoft.VisualStudio.LanguageServices.Xaml (1)
MSBuild (27)
RegisteredTaskObjectCacheBase.cs (13)
25private static Lazy<ConcurrentDictionary<object, object>> s_appDomainLifetimeObjects = new Lazy<ConcurrentDictionary<object, object>>();
30private Lazy<ConcurrentDictionary<object, object>> _buildLifetimeObjects = new Lazy<ConcurrentDictionary<object, object>>();
61ConcurrentDictionary<object, object> dict = GetCollectionForLifetime(lifetime, dontCreate: false);
71ConcurrentDictionary<object, object> dict = GetCollectionForLifetime(lifetime, dontCreate: true);
83ConcurrentDictionary<object, object> dict = GetCollectionForLifetime(lifetime, dontCreate: true);
97var collection = GetCollectionForLifetime(lifetime, dontCreate: true);
104protected ConcurrentDictionary<object, object> GetCollectionForLifetime(RegisteredTaskObjectLifetime lifetime, bool dontCreate)
106Lazy<ConcurrentDictionary<object, object>> dict = GetLazyCollectionForLifetime(lifetime);
120protected Lazy<ConcurrentDictionary<object, object>> GetLazyCollectionForLifetime(RegisteredTaskObjectLifetime lifetime)
122Lazy<ConcurrentDictionary<object, object>> dict = null;
140private static void DisposeObjects(Lazy<ConcurrentDictionary<object, object>> lifetimeObjects)
TypeLoader.cs (11)
34private static ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>> s_cacheOfLoadedTypesByFilter = new ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>>();
39private static ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>> s_cacheOfReflectionOnlyLoadedTypesByFilter = new ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>>();
241private LoadedType GetLoadedType(ConcurrentDictionary<Func<Type, object, bool>, ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes>> cache, string typeName, AssemblyLoadInfo assembly, bool useTaskHost)
245ConcurrentDictionary<AssemblyLoadInfo, AssemblyInfoToLoadedTypes> loadInfoToType =
283private ConcurrentDictionary<string, Type> _typeNameToType;
290private ConcurrentDictionary<string, LoadedType> _publicTypeNameToLoadedType;
mscorlib (1)
netstandard (1)
PresentationFramework (5)
Shared (2)
SignalRSamples (1)
SocialWeather (1)
System.Collections.Concurrent (85)
System\Collections\Concurrent\ConcurrentDictionary.cs (85)
17/// All public and protected members of <see cref="ConcurrentDictionary{TKey,TValue}"/> are thread-safe and may be used
69/// Initializes a new instance of the <see cref="ConcurrentDictionary{TKey,TValue}"/>
77/// Initializes a new instance of the <see cref="ConcurrentDictionary{TKey,TValue}"/>
82/// <see cref="ConcurrentDictionary{TKey,TValue}"/> concurrently, or -1 to indicate a default value.</param>
83/// <param name="capacity">The initial number of elements that the <see cref="ConcurrentDictionary{TKey,TValue}"/> can contain.</param>
90/// Initializes a new instance of the <see cref="ConcurrentDictionary{TKey,TValue}"/>
95/// cref="IEnumerable{T}"/> whose elements are copied to the new <see cref="ConcurrentDictionary{TKey,TValue}"/>.</param>
102/// Initializes a new instance of the <see cref="ConcurrentDictionary{TKey,TValue}"/>
111/// Initializes a new instance of the <see cref="ConcurrentDictionary{TKey,TValue}"/>
115/// <param name="collection">The <see cref="IEnumerable{T}"/> whose elements are copied to the new <see cref="ConcurrentDictionary{TKey,TValue}"/>.</param>
127/// Initializes a new instance of the <see cref="ConcurrentDictionary{TKey,TValue}"/>
133/// The estimated number of threads that will update the <see cref="ConcurrentDictionary{TKey,TValue}"/> concurrently, or -1 to indicate a default value.
136/// <see cref="ConcurrentDictionary{TKey,TValue}"/>.</param>
150/// Initializes a new instance of the <see cref="ConcurrentDictionary{TKey,TValue}"/>
154/// <param name="concurrencyLevel">The estimated number of threads that will update the <see cref="ConcurrentDictionary{TKey,TValue}"/> concurrently, or -1 to indicate a default value.</param>
155/// <param name="capacity">The initial number of elements that the <see cref="ConcurrentDictionary{TKey,TValue}"/> can contain.</param>
233/// Gets an instance of a type that may be used to perform operations on a <see cref="ConcurrentDictionary{TKey, TValue}"/>
254/// Gets an instance of a type that may be used to perform operations on a <see cref="ConcurrentDictionary{TKey, TValue}"/>
357/// Attempts to add the specified key and value to the <see cref="ConcurrentDictionary{TKey, TValue}"/>.
363/// true if the key/value pair was added to the <see cref="ConcurrentDictionary{TKey, TValue}"/> successfully; otherwise, false.
366/// <exception cref="OverflowException">The <see cref="ConcurrentDictionary{TKey, TValue}"/> contains too many elements.</exception>
378/// Determines whether the <see cref="ConcurrentDictionary{TKey, TValue}"/> contains the specified key.
380/// <param name="key">The key to locate in the <see cref="ConcurrentDictionary{TKey, TValue}"/>.</param>
381/// <returns>true if the <see cref="ConcurrentDictionary{TKey, TValue}"/> contains an element with the specified key; otherwise, false.</returns>
386/// Attempts to remove and return the value with the specified key from the <see cref="ConcurrentDictionary{TKey, TValue}"/>.
391/// <see cref="ConcurrentDictionary{TKey,TValue}"/> or the default value of <typeparamref
507/// Attempts to get the value associated with the specified key from the <see cref="ConcurrentDictionary{TKey,TValue}"/>.
512/// the <see cref="ConcurrentDictionary{TKey,TValue}"/> with the specified key or the default value of
515/// <returns>true if the key was found in the <see cref="ConcurrentDictionary{TKey,TValue}"/>; otherwise, false.</returns>
709/// Removes all keys and values from the <see cref="ConcurrentDictionary{TKey,TValue}"/>.
777/// Copies the key and value pairs stored in the <see cref="ConcurrentDictionary{TKey,TValue}"/> to a
780/// <returns>A new array containing a snapshot of key and value pairs copied from the <see cref="ConcurrentDictionary{TKey,TValue}"/>.
851/// cref="ConcurrentDictionary{TKey,TValue}"/>.</summary>
852/// <returns>An enumerator for the <see cref="ConcurrentDictionary{TKey,TValue}"/>.</returns>
870private readonly ConcurrentDictionary<TKey, TValue> _dictionary;
872private ConcurrentDictionary<TKey, TValue>.VolatileNode[]? _buckets;
882public Enumerator(ConcurrentDictionary<TKey, TValue> dictionary)
913ConcurrentDictionary<TKey, TValue>.VolatileNode[]? buckets = _buckets;
1124/// <see cref="ConcurrentDictionary{TKey, TValue}" /> and to provide hash values for the keys.
1127/// <see cref="ConcurrentDictionary{TKey, TValue}" /> requires an equality implementation to determine
1152/// cref="ConcurrentDictionary{TKey,TValue}"/>.
1157/// cref="ConcurrentDictionary{TKey,TValue}"/>.</value>
1159/// cref="ConcurrentDictionary{TKey,TValue}"/>
1193/// Adds a key/value pair to the <see cref="ConcurrentDictionary{TKey,TValue}"/>
1233/// Adds a key/value pair to the <see cref="ConcurrentDictionary{TKey,TValue}"/>
1275/// Adds a key/value pair to the <see cref="ConcurrentDictionary{TKey,TValue}"/>
1307/// Adds a key/value pair to the <see cref="ConcurrentDictionary{TKey,TValue}"/> if the key does not already
1308/// exist, or updates a key/value pair in the <see cref="ConcurrentDictionary{TKey,TValue}"/> if the key
1383/// Adds a key/value pair to the <see cref="ConcurrentDictionary{TKey,TValue}"/> if the key does not already
1384/// exist, or updates a key/value pair in the <see cref="ConcurrentDictionary{TKey,TValue}"/> if the key
1456/// Adds a key/value pair to the <see cref="ConcurrentDictionary{TKey,TValue}"/> if the key does not already
1457/// exist, or updates a key/value pair in the <see cref="ConcurrentDictionary{TKey,TValue}"/> if the key
1522/// Gets a value that indicates whether the <see cref="ConcurrentDictionary{TKey,TValue}"/> is empty.
1524/// <value>true if the <see cref="ConcurrentDictionary{TKey,TValue}"/> is empty; otherwise,
1569/// cref="ConcurrentDictionary{TKey,TValue}"/>.</exception>
1593/// Gets a snapshot containing all the keys in the <see cref="ConcurrentDictionary{TKey,TValue}"/>.
1595/// <remarks>The property returns a copy of all the keys. It's not kept in sync with <see cref="ConcurrentDictionary{TKey,TValue}"/>.</remarks>
1602/// Gets a snapshot containing all the values in the <see cref="ConcurrentDictionary{TKey,TValue}"/>.
1604/// <remarks>The property returns a copy of all the values. It's not kept in sync with <see cref="ConcurrentDictionary{TKey,TValue}"/>.</remarks>
1619/// cref="ConcurrentDictionary{TKey,TValue}"/>.</param>
1623/// cref="ConcurrentDictionary{TKey,TValue}"/>
1626/// <see cref="ConcurrentDictionary{TKey,TValue}"/></exception>
1647/// cref="ConcurrentDictionary{TKey,TValue}"/>, this property always returns
1657/// cref="ConcurrentDictionary{TKey,TValue}"/>.</param>
1670/// cref="ConcurrentDictionary{TKey,TValue}"/>.</summary>
1671/// <returns>An enumerator for the <see cref="ConcurrentDictionary{TKey,TValue}"/>.</returns>
1678IEnumerator IEnumerable.GetEnumerator() => ((ConcurrentDictionary<TKey, TValue>)this).GetEnumerator();
1695/// name="TKey"/> of the <see cref="ConcurrentDictionary{TKey,TValue}"/>. -or-
1697/// the type of values in the <see cref="ConcurrentDictionary{TKey,TValue}"/>.
1699/// cref="ConcurrentDictionary{TKey,TValue}"/>.
1750/// cref="ConcurrentDictionary{TKey,TValue}"/>, this property always
1760/// cref="ConcurrentDictionary{TKey,TValue}"/>, this property always
1807/// cref="ConcurrentDictionary{TKey,TValue}"/>.</value>
1813/// cref="ConcurrentDictionary{TKey,TValue}"/>. -or- A value is being
1816/// cref="ConcurrentDictionary{TKey,TValue}"/>
1848((ConcurrentDictionary<TKey, TValue>)this)[(TKey)key] = (TValue)value!;
1944/// cref="ConcurrentDictionary{TKey,TValue}"/>, this property always
2324internal DictionaryEnumerator(ConcurrentDictionary<TKey, TValue> dictionary) => _enumerator = dictionary.GetEnumerator();
2341private static bool IsCompatibleKey<TAlternateKey>(ConcurrentDictionary<TKey, TValue>.Tables tables)
2350private static IAlternateEqualityComparer<TAlternateKey, TKey> GetAlternateComparer<TAlternateKey>(ConcurrentDictionary<TKey, TValue>.Tables tables)
2358/// Provides a type that may be used to perform operations on a <see cref="ConcurrentDictionary{TKey, TValue}"/>
2365internal AlternateLookup(ConcurrentDictionary<TKey, TValue> dictionary)
2372/// <summary>Gets the <see cref="ConcurrentDictionary{TKey, TValue}"/> against which this instance performs operations.</summary>
2373public ConcurrentDictionary<TKey, TValue> Dictionary { get; }
2389/// <summary>Determines whether the <see cref="ConcurrentDictionary{TKey, TValue}"/> contains the specified alternate key.</summary>
System.ComponentModel.Annotations (4)
System\ComponentModel\DataAnnotations\AssociatedMetadataTypeTypeDescriptor.cs (3)
96private static readonly ConcurrentDictionary<Type, Type?> s_metadataTypeCache = new ConcurrentDictionary<Type, Type?>();
99private static readonly ConcurrentDictionary<(Type, string), Attribute[]> s_typeMemberCache = new ConcurrentDictionary<(Type, string), Attribute[]>();
102private static readonly ConcurrentDictionary<(Type, Type), bool> s_validatedMetadataTypeCache = new ConcurrentDictionary<(Type, Type), bool>();
System.ComponentModel.TypeConverter (4)
System.Data.Common (3)
System.Data.Odbc (3)
System.Diagnostics.DiagnosticSource (12)
System\Diagnostics\Metrics\AggregatorStore.cs (10)
167public ConcurrentDictionary<TObjectSequence, TAggregator> GetLabelValuesDictionary<TStringSequence, TObjectSequence>(in TStringSequence names)
354ConcurrentDictionary<ObjectSequence1, TAggregator> valuesDict1 =
363ConcurrentDictionary<ObjectSequence2, TAggregator> valuesDict2 =
373ConcurrentDictionary<ObjectSequence3, TAggregator> valuesDict3 =
387ConcurrentDictionary<ObjectSequenceMany, TAggregator> valuesDictMany =
415private readonly ConcurrentDictionary<TObjectSequence, TAggregator> _valuesDict;
421ConcurrentDictionary<TObjectSequence, TAggregator> valuesDict,
481ConcurrentDictionary<TStringSequence, ConcurrentDictionary<TObjectSequence, TAggregator>>
488foreach (KeyValuePair<TStringSequence, ConcurrentDictionary<TObjectSequence, TAggregator>> kvName in this)
513public ConcurrentDictionary<TObjectSequence, TAggregator> GetValuesDictionary(in TStringSequence names) =>
System.Net.Http (5)
System.Net.Quic (1)
System.Net.Requests (1)
System.Net.Security (5)
System.Net.Sockets (2)
System.Private.DataContractSerialization (3)
System.Private.Windows.Core (1)
System.Private.Windows.Core.TestUtilities (1)
System.Reflection.MetadataLoadContext (8)
System\Reflection\TypeLoading\Modules\RoModule.Unifier.cs (5)
21private readonly ConcurrentDictionary<RoType, RoArrayType> _szArrayDict = new ConcurrentDictionary<RoType, RoArrayType>();
35private readonly ConcurrentDictionary<RoArrayType.Key, RoArrayType> _mdArrayDict = new ConcurrentDictionary<RoArrayType.Key, RoArrayType>();
48private readonly ConcurrentDictionary<RoType, RoByRefType> _byRefDict = new ConcurrentDictionary<RoType, RoByRefType>();
59private readonly ConcurrentDictionary<RoType, RoPointerType> _pointerDict = new ConcurrentDictionary<RoType, RoPointerType>();
70private readonly ConcurrentDictionary<RoConstructedGenericType.Key, RoConstructedGenericType> _constructedGenericTypeDict = new ConcurrentDictionary<RoConstructedGenericType.Key, RoConstructedGenericType>();
System.Resources.Extensions (1)
System.Runtime.InteropServices (1)
System.Runtime.Serialization.Formatters (2)
System.Security.Cryptography (6)
System.Text.Json (6)
System.Text.RegularExpressions (1)
System.Windows.Forms (4)
System.Xaml (34)
System\Xaml\XamlSchemaContext.cs (26)
133private ConcurrentDictionary<string, string> _preferredPrefixes;
212ConcurrentDictionary<string, string> preferredPrefixes = CreateDictionary<string, string>();
221void UpdatePreferredPrefixes(XmlNsInfo newNamespaces, ConcurrentDictionary<string, string> prefixDict)
349private ConcurrentDictionary<string, string> _xmlNsCompatDict;
352private ConcurrentDictionary<string, string> XmlNsCompatDict
465private ConcurrentDictionary<Type, XamlType> _masterTypeList;
466private ConcurrentDictionary<ReferenceEqualityTuple<Type, XamlType, Type>, object> _masterValueConverterList;
467private ConcurrentDictionary<ReferenceEqualityTuple<MemberInfo, MemberInfo>, XamlMember> _masterMemberList;
468private ConcurrentDictionary<XamlType, Dictionary<string,SpecialBracketCharacters> > _masterBracketCharacterCache;
477private ConcurrentDictionary<XamlType, Dictionary<string, SpecialBracketCharacters> > MasterBracketCharacterCache
488private ConcurrentDictionary<Type, XamlType> MasterTypeList
499private ConcurrentDictionary<ReferenceEqualityTuple<Type, XamlType, Type>, object> MasterValueConverterList
510private ConcurrentDictionary<ReferenceEqualityTuple<MemberInfo, MemberInfo>, XamlMember> MasterMemberList
681private ConcurrentDictionary<String, XamlNamespace> _namespaceByUriList;
682private ConcurrentDictionary<Assembly, XmlNsInfo> _xmlnsInfo;
683private ConcurrentDictionary<WeakRefKey, XmlNsInfo> _xmlnsInfoForDynamicAssemblies;
684private ConcurrentDictionary<Assembly, XmlNsInfo> _xmlnsInfoForUnreferencedAssemblies;
699private ConcurrentDictionary<Assembly, XmlNsInfo> XmlnsInfo
710private ConcurrentDictionary<WeakRefKey, XmlNsInfo> XmlnsInfoForDynamicAssemblies
722private ConcurrentDictionary<String, XamlNamespace> NamespaceByUriList
736private ConcurrentDictionary<Assembly, XmlNsInfo> XmlnsInfoForUnreferencedAssemblies
1004ConcurrentDictionary<string, IList<string>> assemblyMappings = nsInfo.ClrToXmlNs;
1174internal static ConcurrentDictionary<K, V> CreateDictionary<K, V>()
1179internal static ConcurrentDictionary<K, V> CreateDictionary<K, V>(IEqualityComparer<K> comparer)
1184internal static V TryAdd<K, V>(ConcurrentDictionary<K, V> dictionary, K key, V value)
1196internal static V TryUpdate<K, V>(ConcurrentDictionary<K, V> dictionary, K key, V value, V comparand)
Templates.Blazor.Tests (1)
Templates.Blazor.WebAssembly.Auth.Tests (2)
Templates.Blazor.WebAssembly.Tests (2)
Templates.Mvc.Tests (2)
Templates.Tests (2)
TestContentPackage (1)
XmlFileLogger (3)
xunit.assert (6)
xunit.console (3)