28 instantiations of ConcurrentBag
AnalyzerRunner (1)
Program.cs (1)
190var sums = new ConcurrentBag<Statistic>();
Aspire.Components.Common.Tests (1)
TestLoggerFactory.cs (1)
14public ConcurrentBag<string> Categories { get; } = new();
InMemory.FunctionalTests (1)
RequestTests.cs (1)
599var usedIds = new ConcurrentBag<string>();
Microsoft.AspNetCore.Analyzers.Test (6)
MinimalStartupTest.cs (3)
18Analyses = new ConcurrentBag<object>(); 19ConfigureServicesMethods = new ConcurrentBag<IMethodSymbol>(); 20ConfigureMethods = new ConcurrentBag<IMethodSymbol>();
StartupAnalyzerTest.cs (3)
16Analyses = new ConcurrentBag<object>(); 17ConfigureServicesMethods = new ConcurrentBag<IMethodSymbol>(); 18ConfigureMethods = new ConcurrentBag<IMethodSymbol>();
Microsoft.AspNetCore.Components.Endpoints (1)
FormMapping\Converters\CollectionAdapters\ConcurrentBagBufferAdapter.cs (1)
10public static ConcurrentBag<TElement> CreateBuffer() => new();
Microsoft.AspNetCore.Components.Endpoints.Tests (1)
Binding\FormDataMapperTests.cs (1)
785var expected = new ConcurrentBag<int>(new[] { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 });
Microsoft.AspNetCore.Http.Extensions (1)
src\Components\Endpoints\src\FormMapping\Converters\CollectionAdapters\ConcurrentBagBufferAdapter.cs (1)
10public static ConcurrentBag<TElement> CreateBuffer() => new();
Microsoft.Build (1)
BackEnd\Components\Communications\NodeProviderOutOfProc.cs (1)
91ConcurrentBag<NodeInfo> nodes = new();
Microsoft.Build.Engine.UnitTests (1)
ProjectCache\ProjectCacheTests.cs (1)
1373var completedCacheRequests = new ConcurrentBag<int>();
Microsoft.CodeAnalysis.Features (1)
CodeFixes\Suppression\AbstractSuppressionBatchFixAllProvider.cs (1)
146var bag = new ConcurrentBag<(Diagnostic diagnostic, CodeAction action)>();
Microsoft.CodeAnalysis.Test.Utilities (2)
Diagnostics\CommonDiagnosticAnalyzers.cs (1)
1978var diagnostics = new ConcurrentBag<Diagnostic>();
TempFiles\TempRoot.cs (1)
16private readonly ConcurrentBag<IDisposable> _temps = new ConcurrentBag<IDisposable>();
Microsoft.DotNet.Deployment.Tasks.Links (2)
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)
840_runners = new ConcurrentBag<Runner>();
Microsoft.VisualStudio.LanguageServices.Xaml (1)
Implementation\LanguageServer\Handler\Definitions\GoToDefinitionHandler.cs (1)
53var locations = new ConcurrentBag<LSP.Location>();
System.Reflection.MetadataLoadContext (1)
System\Reflection\MetadataLoadContext.Disposing.cs (1)
11private ConcurrentBag<IDisposable> _disposables = new ConcurrentBag<IDisposable>();
96 references to ConcurrentBag
AnalyzerRunner (1)
Program.cs (1)
190var sums = new ConcurrentBag<Statistic>();
Aspire.Components.Common.Tests (1)
TestLoggerFactory.cs (1)
14public ConcurrentBag<string> Categories { get; } = new();
InMemory.FunctionalTests (1)
RequestTests.cs (1)
599var usedIds = new ConcurrentBag<string>();
Microsoft.AspNetCore.Analyzers.Test (6)
MinimalStartupTest.cs (3)
30internal ConcurrentBag<object> Analyses { get; } 32internal ConcurrentBag<IMethodSymbol> ConfigureServicesMethods { get; } 34internal ConcurrentBag<IMethodSymbol> ConfigureMethods { get; }
StartupAnalyzerTest.cs (3)
28internal ConcurrentBag<object> Analyses { get; } 30internal ConcurrentBag<IMethodSymbol> ConfigureServicesMethods { get; } 32internal ConcurrentBag<IMethodSymbol> ConfigureMethods { get; }
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.Components.Endpoints.Tests (3)
Binding\FormDataMapperTests.cs (3)
785var expected = new ConcurrentBag<int>(new[] { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 }); 786CanDeserialize_Collection<ConcurrentBag<int>, ConcurrentBag<int>, int>(expected);
Microsoft.AspNetCore.Http.Extensions (11)
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\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 (1)
BackEnd\Components\Communications\NodeProviderOutOfProc.cs (1)
91ConcurrentBag<NodeInfo> nodes = new();
Microsoft.Build.Engine.UnitTests (1)
ProjectCache\ProjectCacheTests.cs (1)
1373var completedCacheRequests = new ConcurrentBag<int>();
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
NavigateTo\NavigateToSearcherTests.cs (1)
481public readonly ConcurrentBag<INavigateToSearchResult> Results = [];
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.CodeAnalysis.LanguageServer (1)
Testing\TestDiscoverer.DiscoveryHandler.cs (1)
25private readonly ConcurrentBag<TestCase> _testCases = [];
Microsoft.CodeAnalysis.Test.Utilities (2)
Diagnostics\CommonDiagnosticAnalyzers.cs (1)
1978var diagnostics = new ConcurrentBag<Diagnostic>();
TempFiles\TempRoot.cs (1)
16private readonly ConcurrentBag<IDisposable> _temps = new ConcurrentBag<IDisposable>();
Microsoft.DotNet.Deployment.Tasks.Links (2)
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)
764private readonly ConcurrentBag<Runner> _runners;
Microsoft.VisualStudio.LanguageServices.Xaml (1)
Implementation\LanguageServer\Handler\Definitions\GoToDefinitionHandler.cs (1)
53var locations = new ConcurrentBag<LSP.Location>();
netstandard (1)
netstandard.cs (1)
94[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Concurrent.ConcurrentBag<>))]
System (1)
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 258/// Copies the <see cref="ConcurrentBag{T}"/> elements to an existing 264/// <see cref="ConcurrentBag{T}"/>. The <see 275/// cref="ConcurrentBag{T}"/> is greater than the available space from 338/// <see cref="ConcurrentBag{T}"/>. The <see 374/// Copies the <see cref="ConcurrentBag{T}"/> elements to a new array. 377/// cref="ConcurrentBag{T}"/>.</returns> 407/// Removes all values from the <see cref="ConcurrentBag{T}"/>. 452/// cref="ConcurrentBag{T}"/>. 455/// cref="ConcurrentBag{T}"/>.</returns> 466/// cref="ConcurrentBag{T}"/>. 469/// cref="ConcurrentBag{T}"/>.</returns> 478/// Gets the number of elements contained in the <see cref="ConcurrentBag{T}"/>. 480/// <value>The number of elements contained in the <see cref="ConcurrentBag{T}"/>.</value> 527/// Gets a value that indicates whether the <see cref="ConcurrentBag{T}"/> is empty. 529/// <value>true if the <see cref="ConcurrentBag{T}"/> is empty; otherwise, false.</value> 586/// with the SyncRoot; otherwise, false. For <see cref="ConcurrentBag{T}"/>, this property always 690/// <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;