33 instantiations of ConcurrentBag
aspire (1)
Backchannel\AuxiliaryBackchannelMonitor.cs (1)
202var failedSockets = new ConcurrentBag<string>();
Aspire.Hosting (1)
ApplicationModel\EndpointAnnotation.cs (1)
283private readonly ConcurrentBag<NetworkEndpointSnapshot> _snapshots = new();
Aspire.Hosting.Integration.Analyzers (1)
AspireExportAnalyzer.cs (1)
217var bag = exportsByKey.GetOrAdd(key, _ => new ConcurrentBag<(IMethodSymbol, Location)>());
Aspire.TestUtilities (1)
TestLoggerFactory.cs (1)
13public ConcurrentBag<string> Categories { get; } = new();
dotnet (2)
Commands\Test\MTP\MSBuildUtility.cs (1)
382var allProjects = new ConcurrentBag<ParallelizableTestModuleGroupWithSequentialInnerModules>();
Commands\Workload\Install\FileBasedInstaller.cs (1)
163var tempFilesToDelete = new ConcurrentBag<string>();
ILCompiler.ReadyToRun (3)
Compiler\DependencyAnalysis\ReadyToRun\ManifestMetadataTableNode.cs (1)
70private ConcurrentBag<EcmaModule> _modulesWhichMustBeIndexable = new ConcurrentBag<EcmaModule>();
Compiler\DependencyAnalysis\ReadyToRun\TypeValidationChecker.cs (1)
20private ConcurrentBag<(TypeDesc type, string reason)> _typeLoadValidationErrors = new ConcurrentBag<(TypeDesc type, string reason)>();
Compiler\DependencyAnalysis\ReadyToRunCodegenNodeFactory.cs (1)
481private readonly ConcurrentBag<StringDiscoverableAssemblyStubNode> _stringDiscoverableStubs = new ConcurrentBag<StringDiscoverableAssemblyStubNode>();
Microsoft.AspNetCore.Components.Endpoints (1)
FormMapping\Converters\CollectionAdapters\ConcurrentBagBufferAdapter.cs (1)
10public static ConcurrentBag<TElement> CreateBuffer() => new();
Microsoft.AspNetCore.Http.Extensions (1)
src\aspnetcore\src\Components\Endpoints\src\FormMapping\Converters\CollectionAdapters\ConcurrentBagBufferAdapter.cs (1)
10public static ConcurrentBag<TElement> CreateBuffer() => new();
Microsoft.Build (6)
BackEnd\Components\Communications\NodeProviderOutOfProc.cs (1)
90ConcurrentBag<NodeInfo> nodes = new();
BuildCheck\Infrastructure\BuildCheckManagerProvider.cs (2)
75_checkRegistry = new ConcurrentBag<CheckFactoryContext>(); 395var tempColl = new ConcurrentBag<CheckFactoryContext>();
BuildCheck\Infrastructure\EditorConfig\EditorConfigParser.cs (2)
17private static ConcurrentBag<string> editorConfigFilePaths = new ConcurrentBag<string>(); 38editorConfigFilePaths = new ConcurrentBag<string>();
Graph\GraphBuilder.cs (1)
629_projectReferrers.GetOrAdd(referenceInfo.ReferenceConfiguration, _ => new ConcurrentBag<string>())
Microsoft.CodeAnalysis.Analyzers (1)
MetaAnalyzers\DiagnosticAnalyzerAPIUsageAnalyzer.cs (1)
95var diagnosticAnalyzerTypes = new ConcurrentBag<INamedTypeSymbol>();
Microsoft.CodeAnalysis.Features (1)
CodeFixes\Suppression\AbstractSuppressionBatchFixAllProvider.cs (1)
146var bag = new ConcurrentBag<(Diagnostic diagnostic, CodeAction action)>();
Microsoft.DotNet.SourceBuild.Tasks (1)
src\UsageReport\WritePackageUsageData.cs (1)
176var usages = new ConcurrentBag<Usage>();
Microsoft.Maui.Resizetizer (1)
ResizetizeImages.cs (1)
49 var resizedImages = new ConcurrentBag<ResizedImageInfo>();
Microsoft.ML.Core (1)
Utilities\ObjectPool.cs (1)
46_pool = new ConcurrentBag<T>();
Microsoft.ML.Data (1)
DataView\CacheDataView.cs (1)
99_cacheFillerThreads = new ConcurrentBag<Task>();
Microsoft.ML.TensorFlow (1)
TensorflowTransform.cs (1)
638_runners = new ConcurrentBag<Runner>();
Microsoft.ML.Transforms (1)
Text\WordEmbeddingsExtractor.cs (1)
679var parsedData = new ConcurrentBag<(string key, float[] values, long lineNumber)>();
Microsoft.ML.Vision (1)
DnnRetrainTransform.cs (1)
839_runners = new ConcurrentBag<Runner>();
Microsoft.TestPlatform.CrossPlatEngine (1)
PostProcessing\PostProcessingTestRunAttachmentsProcessingEventsHandler.cs (1)
20private readonly ConcurrentBag<AttachmentSet> _attachmentsSet = new();
Microsoft.VisualStudio.TestPlatform.Common (1)
DataCollection\DataCollectionAttachmentManager.cs (1)
174_attachmentTasks.GetOrAdd(fileTransferInfo.Context, _ => new ConcurrentBag<Task>());
NuGet.Build.Tasks.Console (1)
MSBuildStaticGraphRestore.cs (1)
811var additionalMessages = new ConcurrentBag<IAssetsLogMessage>();
NuGet.Commands (3)
RestoreCommand\ProjectRestoreCommand.cs (1)
376var bag = new ConcurrentBag<RemoteMatch>(packagesToInstall);
RestoreCommand\RequestFactory\DependencyGraphSpecRequestProvider.cs (2)
84var requests = new ConcurrentBag<RestoreSummaryRequest>(); 85var toolRequests = new ConcurrentBag<RestoreSummaryRequest>();
System.Reflection.MetadataLoadContext (1)
System\Reflection\MetadataLoadContext.Disposing.cs (1)
11private ConcurrentBag<IDisposable> _disposables = new ConcurrentBag<IDisposable>();
127 references to ConcurrentBag
aspire (2)
Backchannel\AuxiliaryBackchannelMonitor.cs (2)
202var failedSockets = new ConcurrentBag<string>(); 280private async Task TryConnectToSocketAsync(string socketPath, ConcurrentBag<string> failedSockets, CancellationToken cancellationToken)
Aspire.Hosting (1)
ApplicationModel\EndpointAnnotation.cs (1)
283private readonly ConcurrentBag<NetworkEndpointSnapshot> _snapshots = new();
Aspire.Hosting.Integration.Analyzers (4)
AspireExportAnalyzer.cs (4)
75var exportsByKey = new ConcurrentDictionary<(string ExportId, string TargetType), ConcurrentBag<(IMethodSymbol Method, Location Location)>>(); 123ConcurrentDictionary<(string ExportId, string TargetType), ConcurrentBag<(IMethodSymbol Method, Location Location)>> exportsByKey) 217var bag = exportsByKey.GetOrAdd(key, _ => new ConcurrentBag<(IMethodSymbol, Location)>()); 762ConcurrentDictionary<(string ExportId, string TargetType), ConcurrentBag<(IMethodSymbol Method, Location Location)>> exportsByKey)
Aspire.Hosting.Tests (8)
MockImageBuilder.cs (3)
19public ConcurrentBag<IResource> BuildImageResources { get; } = []; 20public ConcurrentBag<ContainerImageBuildOptions?> BuildImageOptions { get; } = []; 21public ConcurrentBag<IResource> PushImageCalls { get; } = [];
Publishing\FakeContainerRuntime.cs (5)
24public ConcurrentBag<(string localImageName, string targetImageName)> TagImageCalls { get; } = []; 25public ConcurrentBag<string> RemoveImageCalls { get; } = []; 26public ConcurrentBag<IResource> PushImageCalls { get; } = []; 27public ConcurrentBag<(string contextPath, string dockerfilePath, ContainerImageBuildOptions? options)> BuildImageCalls { get; } = []; 28public ConcurrentBag<(string registryServer, string username, string password)> LoginToRegistryCalls { get; } = [];
Aspire.TestUtilities (1)
TestLoggerFactory.cs (1)
13public ConcurrentBag<string> Categories { get; } = new();
dotnet (4)
Commands\Test\MTP\MSBuildHandler.cs (1)
14private readonly ConcurrentBag<ParallelizableTestModuleGroupWithSequentialInnerModules> _testApplications = [];
Commands\Test\MTP\MSBuildUtility.cs (2)
376private static (ConcurrentBag<ParallelizableTestModuleGroupWithSequentialInnerModules> Projects, int BuildExitCode) GetProjectsProperties( 382var allProjects = new ConcurrentBag<ParallelizableTestModuleGroupWithSequentialInnerModules>();
Commands\Workload\Install\FileBasedInstaller.cs (1)
163var tempFilesToDelete = new ConcurrentBag<string>();
ILCompiler.ReadyToRun (3)
Compiler\DependencyAnalysis\ReadyToRun\ManifestMetadataTableNode.cs (1)
70private ConcurrentBag<EcmaModule> _modulesWhichMustBeIndexable = new ConcurrentBag<EcmaModule>();
Compiler\DependencyAnalysis\ReadyToRun\TypeValidationChecker.cs (1)
20private ConcurrentBag<(TypeDesc type, string reason)> _typeLoadValidationErrors = new ConcurrentBag<(TypeDesc type, string reason)>();
Compiler\DependencyAnalysis\ReadyToRunCodegenNodeFactory.cs (1)
481private readonly ConcurrentBag<StringDiscoverableAssemblyStubNode> _stringDiscoverableStubs = new ConcurrentBag<StringDiscoverableAssemblyStubNode>();
Microsoft.AspNetCore.Components.Endpoints (11)
FormMapping\Converters\CollectionAdapters\ConcurrentBagBufferAdapter.cs (7)
8internal sealed class ConcurrentBagBufferAdapter<TElement> : ICollectionBufferAdapter<ConcurrentBag<TElement>, ConcurrentBag<TElement>, TElement> 10public static ConcurrentBag<TElement> CreateBuffer() => new(); 12public static ConcurrentBag<TElement> Add(ref ConcurrentBag<TElement> buffer, TElement element) 18public static ConcurrentBag<TElement> ToResult(ConcurrentBag<TElement> buffer) => buffer;
FormMapping\Factories\Collections\TypedCollectionConverterFactory.cs (4)
51var _ when type == (typeof(ConcurrentBag<TElement>)) => true, 141var _ when type.IsAssignableTo(typeof(ConcurrentBag<TElement>)) => 142new CollectionConverter<ConcurrentBag<TElement>, ConcurrentBagBufferAdapter<TElement>, ConcurrentBag<TElement>, TElement>(elementTypeConverter),
Microsoft.AspNetCore.Http.Extensions (11)
src\aspnetcore\src\Components\Endpoints\src\FormMapping\Converters\CollectionAdapters\ConcurrentBagBufferAdapter.cs (7)
8internal sealed class ConcurrentBagBufferAdapter<TElement> : ICollectionBufferAdapter<ConcurrentBag<TElement>, ConcurrentBag<TElement>, TElement> 10public static ConcurrentBag<TElement> CreateBuffer() => new(); 12public static ConcurrentBag<TElement> Add(ref ConcurrentBag<TElement> buffer, TElement element) 18public static ConcurrentBag<TElement> ToResult(ConcurrentBag<TElement> buffer) => buffer;
src\aspnetcore\src\Components\Endpoints\src\FormMapping\Factories\Collections\TypedCollectionConverterFactory.cs (4)
51var _ when type == (typeof(ConcurrentBag<TElement>)) => true, 141var _ when type.IsAssignableTo(typeof(ConcurrentBag<TElement>)) => 142new CollectionConverter<ConcurrentBag<TElement>, ConcurrentBagBufferAdapter<TElement>, ConcurrentBag<TElement>, TElement>(elementTypeConverter),
Microsoft.Build (7)
BackEnd\Components\Communications\NodeProviderOutOfProc.cs (1)
90ConcurrentBag<NodeInfo> nodes = new();
BuildCheck\Infrastructure\BuildCheckManagerProvider.cs (3)
68private readonly ConcurrentBag<CheckFactoryContext> _checkRegistry; 395var tempColl = new ConcurrentBag<CheckFactoryContext>(); 508private readonly ConcurrentBag<BuildCheckRuleTelemetryData> _ruleTelemetryData = [];
BuildCheck\Infrastructure\EditorConfig\EditorConfigParser.cs (1)
17private static ConcurrentBag<string> editorConfigFilePaths = new ConcurrentBag<string>();
Graph\GraphBuilder.cs (2)
62private readonly ConcurrentDictionary<ConfigurationMetadata, ConcurrentBag<string>> _projectReferrers = new(); 545catch (InvalidProjectFileException ex) when (_projectReferrers.TryGetValue(configurationMetadata, out var referrers) && !referrers.IsEmpty)
Microsoft.CodeAnalysis.Analyzers (11)
MetaAnalyzers\DiagnosticAnalyzerAPIUsageAnalyzer.cs (1)
95var diagnosticAnalyzerTypes = new ConcurrentBag<INamedTypeSymbol>();
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer.cs (10)
250var idToAnalyzerMap = new ConcurrentDictionary<string, ConcurrentDictionary<string, ConcurrentBag<Location>>>(); 476var locations = analyzerToDescriptorLocationsMap[analyzerName]; 1196ConcurrentDictionary<string, ConcurrentDictionary<string, ConcurrentBag<Location>>> idToAnalyzerMap) 1217ConcurrentBag<Location> AddLocationFactory(string analyzerName) 1220ConcurrentBag<Location> UpdateLocationsFactory(string analyzerName, ConcurrentBag<Location> bag) 1226ConcurrentDictionary<string, ConcurrentBag<Location>> AddNamedTypeFactory(string r) 1228var dict = new ConcurrentDictionary<string, ConcurrentBag<Location>>(); 1236ConcurrentDictionary<string, ConcurrentBag<Location>> UpdateNamedTypeFactory(string r, ConcurrentDictionary<string, ConcurrentBag<Location>> existingValue)
Microsoft.CodeAnalysis.Features (8)
CodeFixes\Suppression\AbstractSuppressionBatchFixAllProvider.cs (7)
146var bag = new ConcurrentBag<(Diagnostic diagnostic, CodeAction action)>(); 201ConcurrentBag<(Diagnostic diagnostic, CodeAction action)> fixes, 248private static async Task<IReadOnlyDictionary<DocumentId, ConcurrentBag<(CodeAction, Document)>>> GetDocumentIdToChangedDocumentsAsync( 254var documentIdToChangedDocuments = new ConcurrentDictionary<DocumentId, ConcurrentBag<(CodeAction, Document)>>(); 272IReadOnlyDictionary<DocumentId, ConcurrentBag<(CodeAction, Document)>> documentIdToChangedDocuments, 340private static readonly Func<DocumentId, ConcurrentBag<(CodeAction, Document)>> s_getValue = 345ConcurrentDictionary<DocumentId, ConcurrentBag<(CodeAction, Document)>> documentIdToChangedDocuments,
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.BatchFixer.cs (1)
86ConcurrentBag<(Diagnostic diagnostic, CodeAction action)> bag,
Microsoft.DotNet.SourceBuild.Tasks (1)
src\UsageReport\WritePackageUsageData.cs (1)
176var usages = new ConcurrentBag<Usage>();
Microsoft.Maui.Resizetizer (4)
ResizetizeImages.cs (4)
49 var resizedImages = new ConcurrentBag<ResizedImageInfo>(); 164 void ProcessAppIcon(ResizeImageInfo img, ConcurrentBag<ResizedImageInfo> resizedImages) 236 void ProcessImageResize(ResizeImageInfo img, DpiPath[] dpis, ConcurrentBag<ResizedImageInfo> resizedImages) 251 void ProcessImageCopy(ResizeImageInfo img, DpiPath originalScaleDpi, ConcurrentBag<ResizedImageInfo> resizedImages)
Microsoft.ML.Core (1)
Utilities\ObjectPool.cs (1)
38private readonly ConcurrentBag<T> _pool;
Microsoft.ML.Data (1)
DataView\CacheDataView.cs (1)
56private readonly ConcurrentBag<Task> _cacheFillerThreads;
Microsoft.ML.TensorFlow (1)
TensorflowTransform.cs (1)
540private readonly ConcurrentBag<Runner> _runners;
Microsoft.ML.Transforms (1)
Text\WordEmbeddingsExtractor.cs (1)
679var parsedData = new ConcurrentBag<(string key, float[] values, long lineNumber)>();
Microsoft.ML.Vision (1)
DnnRetrainTransform.cs (1)
763private readonly ConcurrentBag<Runner> _runners;
Microsoft.NET.Sdk.StaticWebAssets.Tasks (1)
Data\StaticWebAssetEndpoint.cs (1)
395internal static ITaskItem[] ToTaskItems(ConcurrentBag<StaticWebAssetEndpoint> endpoints)
Microsoft.TestPlatform.CrossPlatEngine (1)
PostProcessing\PostProcessingTestRunAttachmentsProcessingEventsHandler.cs (1)
20private readonly ConcurrentBag<AttachmentSet> _attachmentsSet = new();
Microsoft.VisualStudio.TestPlatform.Common (3)
DataCollection\DataCollectionAttachmentManager.cs (3)
54private readonly ConcurrentDictionary<DataCollectionContext, ConcurrentBag<Task>> _attachmentTasks; 82_attachmentTasks = new ConcurrentDictionary<DataCollectionContext, ConcurrentBag<Task>>(); 140if (_attachmentTasks.TryGetValue(dataCollectionContext, out var tasks))
netstandard (1)
netstandard.cs (1)
94[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Concurrent.ConcurrentBag<>))]
NuGet.Build.Tasks.Console (3)
MSBuildStaticGraphRestore.cs (3)
811var additionalMessages = new ConcurrentBag<IAssetsLogMessage>(); 891ConcurrentBag<IAssetsLogMessage> additionalMessages) 914ConcurrentBag<IAssetsLogMessage> additionalMessages)
NuGet.Commands (3)
RestoreCommand\ProjectRestoreCommand.cs (1)
376var bag = new ConcurrentBag<RemoteMatch>(packagesToInstall);
RestoreCommand\RequestFactory\DependencyGraphSpecRequestProvider.cs (2)
84var requests = new ConcurrentBag<RestoreSummaryRequest>(); 85var toolRequests = new ConcurrentBag<RestoreSummaryRequest>();
System (1)
src\runtime\src\libraries\shims\System\ref\System.cs (1)
133[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Concurrent.ConcurrentBag<>))]
System.Collections.Concurrent (31)
System\Collections\Concurrent\ConcurrentBag.cs (31)
19/// duplicates. <see cref="ConcurrentBag{T}"/> is a thread-safe bag implementation, optimized for 23/// <see cref="ConcurrentBag{T}"/> accepts null reference (Nothing in Visual Basic) as a valid 27/// All public and protected members of <see cref="ConcurrentBag{T}"/> are thread-safe and may be used 42/// <summary>Initializes a new instance of the <see cref="ConcurrentBag{T}"/> class.</summary> 49/// Initializes a new instance of the <see cref="ConcurrentBag{T}"/> 53/// cref="ConcurrentBag{T}"/>.</param> 70/// Adds an object to the <see cref="ConcurrentBag{T}"/>. 73/// <see cref="ConcurrentBag{T}"/>. The value can be a null reference 80/// Attempts to add an object to the <see cref="ConcurrentBag{T}"/>. 83/// <see cref="ConcurrentBag{T}"/>. The value can be a null reference 93/// Attempts to remove and return an object from the <see cref="ConcurrentBag{T}"/>. 96/// removed from the <see cref="ConcurrentBag{T}"/> or the default value 106/// Attempts to return an object from the <see cref="ConcurrentBag{T}"/> without removing it. 109/// the <see cref="ConcurrentBag{T}"/> or the default value of 252/// Copies the <see cref="ConcurrentBag{T}"/> elements to an existing 258/// <see cref="ConcurrentBag{T}"/>. The <see 269/// cref="ConcurrentBag{T}"/> is greater than the available space from 332/// <see cref="ConcurrentBag{T}"/>. The <see 368/// Copies the <see cref="ConcurrentBag{T}"/> elements to a new array. 371/// cref="ConcurrentBag{T}"/>.</returns> 401/// Removes all values from the <see cref="ConcurrentBag{T}"/>. 446/// cref="ConcurrentBag{T}"/>. 449/// cref="ConcurrentBag{T}"/>.</returns> 460/// cref="ConcurrentBag{T}"/>. 463/// cref="ConcurrentBag{T}"/>.</returns> 472/// Gets the number of elements contained in the <see cref="ConcurrentBag{T}"/>. 474/// <value>The number of elements contained in the <see cref="ConcurrentBag{T}"/>.</value> 521/// Gets a value that indicates whether the <see cref="ConcurrentBag{T}"/> is empty. 523/// <value>true if the <see cref="ConcurrentBag{T}"/> is empty; otherwise, false.</value> 580/// with the SyncRoot; otherwise, false. For <see cref="ConcurrentBag{T}"/>, this property always 684/// <summary>Next queue in the <see cref="ConcurrentBag{T}"/>'s set of thread-local queues.</summary>
System.Reflection.MetadataLoadContext (2)
System\Reflection\MetadataLoadContext.Disposing.cs (2)
11private ConcurrentBag<IDisposable> _disposables = new ConcurrentBag<IDisposable>(); 34ConcurrentBag<IDisposable> disposables = _disposables;