1025 references to CompareExchange
Aspire.Hosting.Analyzers (2)
Aspire.Hosting.Integration.Analyzers (2)
dotnet-svcutil-lib (8)
GenerateDocumentationAndConfigFiles (12)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (5)
17=> Interlocked.CompareExchange(ref target, value, null) ?? value;
117/// nearly always more useful than the usual return from <see cref="Interlocked.CompareExchange{T}(ref T, T, T)"/>
135/// nearly always more useful than the usual return from <see cref="Interlocked.CompareExchange{T}(ref T, T, T)"/>
141T oldValue = Interlocked.CompareExchange(ref target, initializedValue, uninitializedValue);
152/// nearly always more useful than the usual return from <see cref="Interlocked.CompareExchange{T}(ref T, T, T)"/>
ILCompiler.Compiler (10)
ILCompiler.ReadyToRun (2)
ILCompiler.RyuJit (1)
ILCompiler.TypeSystem (13)
Microsoft.AspNetCore.App.Analyzers (1)
Microsoft.AspNetCore.Cryptography.Internal (2)
Microsoft.AspNetCore.DataProtection (1)
Microsoft.AspNetCore.DataProtection.Extensions (1)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (1)
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (1)
Microsoft.AspNetCore.Razor.Utilities.Shared (4)
Microsoft.AspNetCore.Routing (1)
Microsoft.AspNetCore.Server.HttpSys (1)
Microsoft.AspNetCore.Server.IIS (3)
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (2)
Microsoft.AspNetCore.SignalR.Client.Core (1)
Microsoft.AspNetCore.SignalR.Core (1)
Microsoft.Build (12)
Microsoft.Build.Framework (2)
Microsoft.Build.Tasks.Core (1)
Microsoft.CodeAnalysis (56)
Emit\CommonPEModuleBuilder.cs (7)
249if (Interlocked.CompareExchange(ref _lazyArrayMethods, result, null) != null)
903Interlocked.CompareExchange(ref NestedTypes, new ConcurrentQueue<Cci.INestedTypeDefinition>(), null);
995Interlocked.CompareExchange(ref defs.Methods, new ConcurrentQueue<Cci.IMethodDefinition>(), null);
1008Interlocked.CompareExchange(ref defs.Properties, new ConcurrentQueue<Cci.IPropertyDefinition>(), null);
1021Interlocked.CompareExchange(ref defs.Fields, new ConcurrentQueue<Cci.IFieldDefinition>(), null);
1040Interlocked.CompareExchange(ref _lazySynthesizedNamespaceMembers, new ConcurrentDictionary<INamespaceSymbolInternal, ConcurrentQueue<INamespaceOrTypeSymbolInternal>>(), null);
1155if (Interlocked.CompareExchange(ref _lazyPrivateImplementationDetails, result, null) != null)
InternalUtilities\InterlockedOperations.cs (5)
17=> Interlocked.CompareExchange(ref target, value, null) ?? value;
117/// nearly always more useful than the usual return from <see cref="Interlocked.CompareExchange{T}(ref T, T, T)"/>
135/// nearly always more useful than the usual return from <see cref="Interlocked.CompareExchange{T}(ref T, T, T)"/>
141T oldValue = Interlocked.CompareExchange(ref target, initializedValue, uninitializedValue);
152/// nearly always more useful than the usual return from <see cref="Interlocked.CompareExchange{T}(ref T, T, T)"/>
Syntax\SyntaxNode.cs (7)
146Interlocked.CompareExchange(ref field, green.CreateRed(this, this.GetChildPosition(slot)), null);
164Interlocked.CompareExchange(ref field, green.CreateRed(this, this.Position), null);
181Interlocked.CompareExchange(ref field, (T)green.CreateRed(this, this.GetChildPosition(slot)), null);
199Interlocked.CompareExchange(ref field, (T)green.CreateRed(this, this.Position), null);
222Interlocked.CompareExchange(ref element, green.CreateRed(this.Parent, this.GetChildPosition(slot)), null);
244Interlocked.CompareExchange(ref element, green.CreateRed(this.Parent, this.GetChildPosition(1)), null);
279if (Interlocked.CompareExchange(ref slot, newWeakReference, previousWeakReference) == previousWeakReference)
Microsoft.CodeAnalysis.Analyzers (12)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (5)
17=> Interlocked.CompareExchange(ref target, value, null) ?? value;
117/// nearly always more useful than the usual return from <see cref="Interlocked.CompareExchange{T}(ref T, T, T)"/>
135/// nearly always more useful than the usual return from <see cref="Interlocked.CompareExchange{T}(ref T, T, T)"/>
141T oldValue = Interlocked.CompareExchange(ref target, initializedValue, uninitializedValue);
152/// nearly always more useful than the usual return from <see cref="Interlocked.CompareExchange{T}(ref T, T, T)"/>
Microsoft.CodeAnalysis.AnalyzerUtilities (12)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (5)
17=> Interlocked.CompareExchange(ref target, value, null) ?? value;
117/// nearly always more useful than the usual return from <see cref="Interlocked.CompareExchange{T}(ref T, T, T)"/>
135/// nearly always more useful than the usual return from <see cref="Interlocked.CompareExchange{T}(ref T, T, T)"/>
141T oldValue = Interlocked.CompareExchange(ref target, initializedValue, uninitializedValue);
152/// nearly always more useful than the usual return from <see cref="Interlocked.CompareExchange{T}(ref T, T, T)"/>
Microsoft.CodeAnalysis.CodeStyle (11)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (5)
17=> Interlocked.CompareExchange(ref target, value, null) ?? value;
117/// nearly always more useful than the usual return from <see cref="Interlocked.CompareExchange{T}(ref T, T, T)"/>
135/// nearly always more useful than the usual return from <see cref="Interlocked.CompareExchange{T}(ref T, T, T)"/>
141T oldValue = Interlocked.CompareExchange(ref target, initializedValue, uninitializedValue);
152/// nearly always more useful than the usual return from <see cref="Interlocked.CompareExchange{T}(ref T, T, T)"/>
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
Microsoft.CodeAnalysis.CSharp (236)
Compilation\CSharpCompilation.cs (13)
88Interlocked.CompareExchange(ref _conversions, new BuckStopsHereBinder(this, associatedFileIdentifier: null).Conversions, null);
175Interlocked.CompareExchange(ref field, new ExtendedErrorTypeSymbol(this, name: "var", arity: 0, errorInfo: null, variableUsedBeforeDeclaration: true), null);
188Interlocked.CompareExchange(ref field, new ExtendedErrorTypeSymbol(this, name: "var", arity: 0, errorInfo: null, unreported: false), null);
1512Interlocked.CompareExchange(ref _lazyGlobalNamespace, result, null);
1578Interlocked.CompareExchange(ref _externAliasTargets, new ConcurrentDictionary<string, NamespaceSymbol>(), null);
1623Interlocked.CompareExchange(ref _lazyScriptClass, BindScriptClass()!, ErrorTypeSymbol.UnknownResultType);
1888Interlocked.CompareExchange(ref _lazyHostObjectTypeSymbol, symbol, null);
1987Interlocked.CompareExchange(ref _lazyEntryPoint, entryPoint, null);
2673binderFactories = Interlocked.CompareExchange(ref cachedBinderFactories, binderFactories, null) ?? binderFactories;
2701if (Interlocked.CompareExchange(ref slot!, newWeakReference, previousWeakReference) == previousWeakReference)
2720if (_lazyCompilationUnitCompletedTrees == null) Interlocked.CompareExchange(ref _lazyCompilationUnitCompletedTrees, new HashSet<SyntaxTree>(), null);
2945Interlocked.CompareExchange(ref _lazyDeclarationDiagnostics, diagnostics, null);
3383var recent = Interlocked.CompareExchange(ref _usageOfUsingsRecordedInTrees, updated, current);
Symbols\Metadata\PE\PENamedTypeSymbol.cs (14)
107return Interlocked.CompareExchange(ref _lazyUncommonProperties, result, null) ?? result;
430Interlocked.CompareExchange(ref uncommon.LazyExtensionParameter, new StrongBox<ParameterSymbol?>(extensionParameter), null);
468Interlocked.CompareExchange(ref uncommon.LazyMarkerMethodSymbol, new PEMethodSymbol(@this.ContainingPEModule, @this, uncommon.MarkerMethodHandle), null);
494Interlocked.CompareExchange(ref uncommon.LazyImplementationMap, new ConcurrentDictionary<MethodSymbol, MethodSymbol?>(ReferenceEqualityComparer.Instance), null);
728Interlocked.CompareExchange(ref _lazyBaseType, MakeAcyclicBaseType(), ErrorTypeSymbol.UnknownResultType);
776Interlocked.CompareExchange(ref _lazyDeclaredBaseType, baseType, ErrorTypeSymbol.UnknownResultType);
1149Interlocked.CompareExchange(ref _lazyMemberNames, CreateReadOnlyMemberNames(names), null);
1707Interlocked.CompareExchange(ref uncommon.lazyEnumUnderlyingType, underlyingType, null);
1910var exchangeResult = Interlocked.CompareExchange(ref _lazyMembersByName, membersDict, null);
2028var exchangeResult = Interlocked.CompareExchange(ref _lazyNestedTypes, typesDict, null);
2042var exchangeResult = Interlocked.CompareExchange(ref _lazyNestedTypes, GroupByName(groupingNestedTypes), null);
2823Interlocked.CompareExchange(ref uncommon.lazyDefaultMemberName, defaultMemberName ?? "", null);
2993Interlocked.CompareExchange(ref uncommon.lazyComImportCoClassType, coClassType, ErrorTypeSymbol.UnknownResultType);
3134Interlocked.CompareExchange(
Symbols\MetadataOrSourceAssemblySymbol.cs (9)
90Interlocked.CompareExchange(ref _lazySpecialTypes,
94if ((object)Interlocked.CompareExchange(ref _lazySpecialTypes[(int)typeId], corType, null) != null)
128Interlocked.CompareExchange(ref _lazyTypeNames, UnionCollection<string>.Create(this.Modules, m => m.TypeNames), null);
141Interlocked.CompareExchange(ref _lazyNativeIntegerTypes, new NativeIntegerTypeSymbol[2], null);
153Interlocked.CompareExchange(ref _lazyNativeIntegerTypes[index], new NativeIntegerTypeSymbol(underlyingType), null);
165Interlocked.CompareExchange(ref _lazyNamespaceNames, UnionCollection<string>.Create(this.Modules, m => m.NamespaceNames), null);
201Interlocked.CompareExchange(ref _lazySpecialTypeMembers, specialTypeMembers, null);
213Interlocked.CompareExchange(ref _lazySpecialTypeMembers[(int)member], result, ErrorTypeSymbol.UnknownResultType);
230Interlocked.CompareExchange(ref _lazyTypeConversions, new TypeConversions(this), null);
Symbols\NamedTypeSymbol.cs (6)
2261Interlocked.CompareExchange(ref lazyUnionData._lazyMemberProviderInterface, calculateMemberProviderInterface(), ErrorTypeSymbol.UnknownResultType);
2356Interlocked.CompareExchange(ref _lazyUncommonProperties, new UncommonProperties(), null);
2371Interlocked.CompareExchange(ref lazyUncommonProperties._lazyUnionData, IsDefinition ? new UnionDataForDefinition() : new UnionData(), null);
2387Interlocked.CompareExchange(ref lazyUncommonProperties._lazyClosedClassData, new ClosedClassData(), null);
2437Interlocked.CompareExchange(ref lazyUnionData._lazyValueProperty, result, ErrorTypeSymbol.UnknownResultType);
2635Interlocked.CompareExchange(ref lazyUnionData._lazyHasValueProperty, result, ErrorTypeSymbol.UnknownResultType);
Symbols\Source\SourceAssemblySymbol.cs (7)
199Interlocked.CompareExchange(ref lazyAssemblyIdentity, ComputeIdentity(), null);
548Interlocked.CompareExchange(ref _lazyStrongNameKeys, ComputeStrongNameKeys(), null);
1179Interlocked.CompareExchange(ref _lazyOmittedAttributeIndices, new ConcurrentSet<int>(), null);
1367Interlocked.CompareExchange(ref lazyNetModuleAttributesBag, CustomAttributesBag<CSharpAttributeData>.Empty, null);
1448if (Interlocked.CompareExchange(ref lazyNetModuleAttributesBag, netModuleAttributesBag, null) == null)
2166Interlocked.CompareExchange(ref _optimisticallyGrantedInternalsAccess, new ConcurrentDictionary<AssemblySymbol, bool>(), null);
2308Interlocked.CompareExchange(ref lazyInternalsVisibleToMap,
Symbols\Source\SourceMemberContainerSymbol.cs (6)
1420if (Interlocked.CompareExchange(ref _lazyTypeMembers, MakeTypeMembers(diagnostics), null) == null)
1742Interlocked.CompareExchange(ref _lazyEarlyAttributeDecodingMembersDictionary, membersByName, null);
1803var alreadyKnown = Interlocked.CompareExchange(ref _lazyMembersAndInitializers, membersAndInitializers, null);
1915if (Interlocked.CompareExchange(ref _lazyMembersDictionary, membersDictionary, null) == null)
3698var alreadyKnown = Interlocked.CompareExchange(ref _lazyDeclaredMembersAndInitializers, declaredMembersAndInitializers, DeclaredMembersAndInitializers.UninitializedSentinel);
6333Interlocked.CompareExchange(ref _lazyExtensionGroupingInfo, new ExtensionGroupingInfo(this), null);
Symbols\Source\SourceNamedTypeSymbol_Extension.cs (7)
1024Interlocked.CompareExchange(ref _lazyExtensionInfo.LazyExtensionParameter, new ReceiverParameterSymbol(this, parameter), null);
1046Interlocked.CompareExchange(ref _lazyExtensionInfo, new ExtensionInfo(), null);
1057Interlocked.CompareExchange(ref _lazyExtensionInfo.LazyImplementationMap, builder.ToImmutable(), null);
1070Interlocked.CompareExchange(ref _lazyExtensionInfo, new ExtensionInfo(), null);
1075Interlocked.CompareExchange(ref _lazyExtensionInfo.LazyExtensionMarker, tryCreateExtensionMarker(), ErrorMethodSymbol.UnknownMethod);
1109Interlocked.CompareExchange(ref _lazyExtensionInfo, new ExtensionInfo(), null);
1132Interlocked.CompareExchange(ref _lazyExtensionInfo, new ExtensionInfo(), null);
Symbols\Source\SourcePropertySymbolBase.cs (6)
788Interlocked.CompareExchange(ref _lazyMergedBackingField, new StrongBox<SynthesizedBackingFieldSymbol?>(backingField), null);
801Interlocked.CompareExchange(ref _lazyDeclaredBackingField, CreateBackingField(), null);
809Interlocked.CompareExchange(ref _lazyMergedBackingField, new StrongBox<SynthesizedBackingFieldSymbol?>(backingField), null);
1263Interlocked.CompareExchange(ref _lazyOverriddenOrHiddenMembers, this.MakeOverriddenOrHiddenMembers(), null);
1289Interlocked.CompareExchange(ref _lazySynthesizedSealedAccessor, MakeSynthesizedSealedAccessor(), null);
1370bagCreatedOnThisThread = Interlocked.CompareExchange(ref _lazyCustomAttributesBag, attributesBag, null) == null;
Symbols\TypeSymbol.cs (6)
76return Interlocked.CompareExchange(ref _implementationForInterfaceMemberMap, map, null) ?? map;
118return Interlocked.CompareExchange(ref _lazyInterfaceInfo, info, null) ?? info;
395Interlocked.CompareExchange(ref info.interfacesAndTheirBaseInterfaces, MakeInterfacesAndTheirBaseInterfaces(this.InterfacesNoUseSiteDiagnostics()), null);
2305Interlocked.CompareExchange(ref info.explicitInterfaceImplementationMap, MakeExplicitInterfaceImplementationMap(), null);
2347Interlocked.CompareExchange(ref info.synthesizedMethodImplMap, makeSynthesizedMethodImplMap(), null);
2412Interlocked.CompareExchange(ref _lazyAbstractMembers, ComputeAbstractMembers(), null);
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
Microsoft.CodeAnalysis.CSharp.Features (2)
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
Microsoft.CodeAnalysis.Extensions.Package (5)
Microsoft.CodeAnalysis.Features (7)
Microsoft.CodeAnalysis.NetAnalyzers (6)
Microsoft.CodeAnalysis.Razor.Compiler (9)
Language\Syntax\SyntaxNode.cs (5)
54Interlocked.CompareExchange(ref field, green.CreateRed(this, GetChildPosition(slot)), null);
72Interlocked.CompareExchange(ref field, green.CreateRed(this, Position), null);
90Interlocked.CompareExchange(ref field, (T)green.CreateRed(this, this.GetChildPosition(slot)), null);
109Interlocked.CompareExchange(ref field, (T)green.CreateRed(this, Position), null);
127Interlocked.CompareExchange(ref element, green.CreateRed(Parent, GetChildPosition(slot)), null);
Microsoft.CodeAnalysis.ResxSourceGenerator (11)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (5)
17=> Interlocked.CompareExchange(ref target, value, null) ?? value;
117/// nearly always more useful than the usual return from <see cref="Interlocked.CompareExchange{T}(ref T, T, T)"/>
135/// nearly always more useful than the usual return from <see cref="Interlocked.CompareExchange{T}(ref T, T, T)"/>
141T oldValue = Interlocked.CompareExchange(ref target, initializedValue, uninitializedValue);
152/// nearly always more useful than the usual return from <see cref="Interlocked.CompareExchange{T}(ref T, T, T)"/>
Microsoft.CodeAnalysis.Scripting (2)
Microsoft.CodeAnalysis.VisualBasic (69)
Symbols\Source\SourceModuleSymbol.vb (5)
187Interlocked.CompareExchange(_lazyGlobalNamespace, globalNS, Nothing)
262Interlocked.CompareExchange(_lazyQuickAttributeChecker, CreateQuickAttributeChecker(), Nothing)
353If Interlocked.CompareExchange(_lazyBoundImports, BindImports(cancellationToken), Nothing) Is Nothing Then
828Return Interlocked.CompareExchange(variable, value, comparand) Is comparand AndAlso comparand Is Nothing
834stored = Interlocked.CompareExchange(variable, value, comparand) Is comparand
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (1)
Microsoft.CodeAnalysis.VisualBasic.Features (1)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (2)
Microsoft.CodeAnalysis.Workspaces (29)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (5)
17=> Interlocked.CompareExchange(ref target, value, null) ?? value;
117/// nearly always more useful than the usual return from <see cref="Interlocked.CompareExchange{T}(ref T, T, T)"/>
135/// nearly always more useful than the usual return from <see cref="Interlocked.CompareExchange{T}(ref T, T, T)"/>
141T oldValue = Interlocked.CompareExchange(ref target, initializedValue, uninitializedValue);
152/// nearly always more useful than the usual return from <see cref="Interlocked.CompareExchange{T}(ref T, T, T)"/>
Microsoft.CSharp (3)
Microsoft.DotNet.HotReload.Watch (1)
Microsoft.DotNet.HotReload.WebAssembly.Browser (2)
Microsoft.Extensions.AI.Evaluation.Safety (1)
Microsoft.Extensions.AI.OpenAI (1)
Microsoft.Extensions.Caching.Hybrid (1)
Microsoft.Extensions.Caching.Memory (1)
Microsoft.Extensions.Caching.StackExchangeRedis (1)
Microsoft.Extensions.Diagnostics (1)
Microsoft.Extensions.Diagnostics.Testing (1)
Microsoft.Extensions.DotNetDeltaApplier (1)
Microsoft.Extensions.ML (1)
Microsoft.Extensions.ObjectPool (2)
Microsoft.Extensions.Primitives (1)
Microsoft.Extensions.ServiceDiscovery (2)
Microsoft.Extensions.Validation.ValidationsGenerator (1)
Microsoft.Maui.Controls (1)
Microsoft.ML.CodeAnalyzer.Tests (1)
Microsoft.ML.Core (6)
Microsoft.ML.Data (17)
Data\Combiner.cs (5)
28Interlocked.CompareExchange(ref _instance, new TextCombiner(), null) ??
54Interlocked.CompareExchange(ref _instance, new FloatAdder(), null) ??
76Interlocked.CompareExchange(ref _instance, new R4Adder(), null);
98Interlocked.CompareExchange(ref _instance, new R8Adder(), null) ??
121Interlocked.CompareExchange(ref _instance, new U4Adder(), null) ??
Microsoft.ML.DataView (16)
DataViewType.cs (16)
100Interlocked.CompareExchange(ref _instance, new TextDataViewType(), null) ??
141Interlocked.CompareExchange(ref _instSByte, new NumberDataViewType(typeof(sbyte)), null) ??
155Interlocked.CompareExchange(ref _instByte, new NumberDataViewType(typeof(byte)), null) ??
169Interlocked.CompareExchange(ref _instInt16, new NumberDataViewType(typeof(short)), null) ??
183Interlocked.CompareExchange(ref _instUInt16, new NumberDataViewType(typeof(ushort)), null) ??
197Interlocked.CompareExchange(ref _instInt32, new NumberDataViewType(typeof(int)), null) ??
211Interlocked.CompareExchange(ref _instUInt32, new NumberDataViewType(typeof(uint)), null) ??
225Interlocked.CompareExchange(ref _instInt64, new NumberDataViewType(typeof(long)), null) ??
239Interlocked.CompareExchange(ref _instUInt64, new NumberDataViewType(typeof(ulong)), null) ??
253Interlocked.CompareExchange(ref _instSingle, new NumberDataViewType(typeof(float)), null) ??
267Interlocked.CompareExchange(ref _instDouble, new NumberDataViewType(typeof(double)), null) ??
298Interlocked.CompareExchange(ref _instance, new RowIdDataViewType(), null) ??
337Interlocked.CompareExchange(ref _instance, new BooleanDataViewType(), null) ??
376Interlocked.CompareExchange(ref _instance, new DateTimeDataViewType(), null) ??
412Interlocked.CompareExchange(ref _instance, new DateTimeOffsetDataViewType(), null) ??
448Interlocked.CompareExchange(ref _instance, new TimeSpanDataViewType(), null) ??
Microsoft.ML.FastTree (2)
Microsoft.ML.Tests (2)
Microsoft.ML.Tokenizers (3)
Microsoft.ML.Transforms (7)
Mono.Cecil (64)
Mono.Cecil.Cil\Symbols.cs (9)
125 Interlocked.CompareExchange (ref scopes, new Collection<ScopeDebugInformation> (), null);
138 Interlocked.CompareExchange (ref variables, new Collection<VariableDebugInformation> (), null);
151 Interlocked.CompareExchange (ref constants, new Collection<ConstantDebugInformation> (), null);
289 Interlocked.CompareExchange (ref custom_infos, new Collection<CustomDebugInformation> (), null);
445 Interlocked.CompareExchange (ref targets, new Collection<ImportTarget> (), null);
529 Interlocked.CompareExchange (ref yields, new Collection<InstructionOffset> (), null);
538 Interlocked.CompareExchange (ref resumes, new Collection<InstructionOffset> (), null);
741 Interlocked.CompareExchange (ref sequence_points, new Collection<SequencePoint> (), null);
1261 Interlocked.CompareExchange (ref collection, new Collection<CustomDebugInformation> (), null);
Mono.Cecil\ModuleDefinition.cs (12)
314 Interlocked.CompareExchange (ref projections, new WindowsRuntimeProjections (this), null);
388 Interlocked.CompareExchange (ref reflection_importer, new DefaultReflectionImporter (this), null);
397 Interlocked.CompareExchange (ref metadata_importer, new DefaultMetadataImporter (this), null);
430 Interlocked.CompareExchange (ref metadata_resolver, new MetadataResolver (this.AssemblyResolver), null);
439 Interlocked.CompareExchange (ref type_system, TypeSystem.CreateTypeSystem (this), null);
462 Interlocked.CompareExchange (ref references, new Collection<AssemblyNameReference> (), null);
484 Interlocked.CompareExchange (ref modules, new Collection<ModuleReference> (), null);
509 Interlocked.CompareExchange (ref resources, new Collection<Resource> (), null);
544 Interlocked.CompareExchange (ref types, new TypeDefinitionCollection (this), null);
566 Interlocked.CompareExchange (ref exported_types, new Collection<ExportedType> (), null);
599 Interlocked.CompareExchange (ref custom_infos, new Collection<CustomDebugInformation> (), null);
614 Interlocked.CompareExchange (ref documents, new Collection<Document> (), null);
Mono.Cecil\TypeDefinition.cs (7)
136 Interlocked.CompareExchange (ref interfaces, new InterfaceImplementationCollection (this), null);
158 Interlocked.CompareExchange (ref nested_types, new MemberDefinitionCollection<TypeDefinition> (this), null);
180 Interlocked.CompareExchange (ref methods, new MemberDefinitionCollection<MethodDefinition> (this) , null);
202 Interlocked.CompareExchange (ref fields, new MemberDefinitionCollection<FieldDefinition> (this), null);
224 Interlocked.CompareExchange (ref events, new MemberDefinitionCollection<EventDefinition> (this), null);
246 Interlocked.CompareExchange (ref properties, new MemberDefinitionCollection<PropertyDefinition> (this), null);
540 Interlocked.CompareExchange (ref custom_attributes, new Collection<CustomAttribute> (), null);
NuGet.Protocol (3)
PresentationCore (4)
PresentationFramework (12)
Roslyn.Diagnostics.Analyzers (12)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (5)
17=> Interlocked.CompareExchange(ref target, value, null) ?? value;
117/// nearly always more useful than the usual return from <see cref="Interlocked.CompareExchange{T}(ref T, T, T)"/>
135/// nearly always more useful than the usual return from <see cref="Interlocked.CompareExchange{T}(ref T, T, T)"/>
141T oldValue = Interlocked.CompareExchange(ref target, initializedValue, uninitializedValue);
152/// nearly always more useful than the usual return from <see cref="Interlocked.CompareExchange{T}(ref T, T, T)"/>
Roslyn.Diagnostics.VisualBasic.Analyzers (1)
System.Collections.Concurrent (5)
System.Collections.Immutable (15)
System\Collections\Immutable\ImmutableInterlocked.cs (15)
49T interlockedResult = Interlocked.CompareExchange(ref location, newValue, oldValue);
96T interlockedResult = Interlocked.CompareExchange(ref location, newValue, oldValue);
138T[]? interlockedResult = Interlocked.CompareExchange(ref Unsafe.AsRef(in location.array), newImmutableArray.array, oldArray);
185T[]? interlockedResult = Interlocked.CompareExchange(ref Unsafe.AsRef(in location.array), newImmutableArray.array, oldArray);
219return new ImmutableArray<T>(Interlocked.CompareExchange(ref Unsafe.AsRef(in location.array), value.array, comparand.array));
323ImmutableDictionary<TKey, TValue> interlockedResult = Interlocked.CompareExchange(ref location, updatedCollection, priorCollection);
371ImmutableDictionary<TKey, TValue> interlockedResult = Interlocked.CompareExchange(ref location, updatedCollection, priorCollection);
418ImmutableDictionary<TKey, TValue> interlockedResult = Interlocked.CompareExchange(ref location, updatedCollection, priorCollection);
452ImmutableDictionary<TKey, TValue> interlockedResult = Interlocked.CompareExchange(ref location, updatedCollection, priorCollection);
487ImmutableDictionary<TKey, TValue> interlockedResult = Interlocked.CompareExchange(ref location, updatedCollection, priorCollection);
518ImmutableDictionary<TKey, TValue> interlockedResult = Interlocked.CompareExchange(ref location, updatedCollection, priorCollection);
552ImmutableStack<T> interlockedResult = Interlocked.CompareExchange(ref location, updatedCollection, priorCollection);
575ImmutableStack<T> interlockedResult = Interlocked.CompareExchange(ref location, updatedCollection, priorCollection);
607ImmutableQueue<T> interlockedResult = Interlocked.CompareExchange(ref location, updatedCollection, priorCollection);
630ImmutableQueue<T> interlockedResult = Interlocked.CompareExchange(ref location, updatedCollection, priorCollection);
System.ComponentModel.Composition (1)
System.ComponentModel.TypeConverter (2)
System.Configuration.ConfigurationManager (1)
System.Console (2)
System.Data.Common (1)
System.Data.Odbc (2)
System.Data.OleDb (1)
System.Diagnostics.DiagnosticSource (25)
System\Diagnostics\Activity.cs (13)
254Interlocked.CompareExchange(ref _id, id, null);
286Interlocked.CompareExchange(ref _parentId, parentId, null);
290Interlocked.CompareExchange(ref _parentId, Parent.Id, null);
325Interlocked.CompareExchange(ref _rootId, rootId, null);
499if (_tags != null || Interlocked.CompareExchange(ref _tags, new TagsLinkedList(kvp), null) != null)
523if (_tags != null || Interlocked.CompareExchange(ref _tags, new TagsLinkedList(kvp, set: true), null) != null)
538if (_events != null || Interlocked.CompareExchange(ref _events, new DiagLinkedList<ActivityEvent>(e), null) != null)
623if (_links != null || Interlocked.CompareExchange(ref _links, new DiagLinkedList<ActivityLink>(link), null) != null)
644if (_baggage != null || Interlocked.CompareExchange(ref _baggage, new BaggageLinkedList(kvp), null) != null)
668if (_baggage != null || Interlocked.CompareExchange(ref _baggage, new BaggageLinkedList(kvp, set: true), null) != null)
924Interlocked.CompareExchange(ref _spanId, spanId, null);
1009Interlocked.CompareExchange(ref _parentSpanId, parentSpanId, null);
1150Interlocked.CompareExchange(ref _customProperties, new Dictionary<string, object>(), null);
System\Diagnostics\Metrics\AggregatorStore.cs (5)
250Interlocked.CompareExchange(ref NoLabelAggregator, aggregator, null);
266Interlocked.CompareExchange(ref Label1, new FixedSizeLabelNameDictionary<StringSequence1, ObjectSequence1, TAggregator>(), null);
273Interlocked.CompareExchange(ref Label2, new FixedSizeLabelNameDictionary<StringSequence2, ObjectSequence2, TAggregator>(), null);
280Interlocked.CompareExchange(ref Label3, new FixedSizeLabelNameDictionary<StringSequence3, ObjectSequence3, TAggregator>(), null);
287Interlocked.CompareExchange(ref LabelMany, new FixedSizeLabelNameDictionary<StringSequenceMany, ObjectSequenceMany, TAggregator>(), null);
System.Diagnostics.PerformanceCounter (1)
System.Diagnostics.TraceSource (1)
System.IO.Pipes (1)
System.Linq.Expressions (4)
System.Net.Http (7)
System.Net.Http.WinHttpHandler (2)
System.Net.HttpListener (6)
System\Net\Managed\HttpEndPointListener.cs (6)
332} while (Interlocked.CompareExchange(ref _unhandledPrefixes, future, current) != current);
344} while (Interlocked.CompareExchange(ref _allPrefixes, future, current) != current);
358} while (Interlocked.CompareExchange(ref _prefixes, p2, prefs) != prefs);
373} while (Interlocked.CompareExchange(ref _unhandledPrefixes, future, current) != current);
387} while (Interlocked.CompareExchange(ref _allPrefixes, future, current) != current);
401} while (Interlocked.CompareExchange(ref _prefixes, p2, prefs) != prefs);
System.Net.Quic (3)
System.Net.Security (6)
System.Net.Sockets (9)
System.Net.WebClient (3)
System.Net.WebSockets.Client (2)
System.Private.CoreLib (86)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CultureInfo.cs (9)
146Interlocked.CompareExchange(ref s_userDefaultCulture, GetUserDefaultCulture(), null);
152Interlocked.CompareExchange(ref s_userDefaultUICulture, GetUserDefaultUICulture(), null);
373Interlocked.CompareExchange(ref s_asyncLocalCurrentCulture, new AsyncLocal<CultureInfo>(AsyncLocalSetCurrentCulture), null);
395Interlocked.CompareExchange(ref s_asyncLocalCurrentUICulture, new AsyncLocal<CultureInfo>(AsyncLocalSetCurrentUICulture), null);
514Interlocked.CompareExchange<CultureInfo?>(ref _parent, culture, null);
710Interlocked.CompareExchange(ref _numInfo, temp, null);
736Interlocked.CompareExchange(ref _dateTimeInfo, temp, null);
1123cache = Interlocked.CompareExchange(ref s_cachedCulturesByName, cache, null) ?? cache;
1138cache = Interlocked.CompareExchange(ref s_cachedCulturesByLcid, cache, null) ?? cache;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (9)
199Interlocked.CompareExchange(ref s_currentActiveTasks, new Dictionary<int, Task>(), null) ??
228Interlocked.CompareExchange(ref s_runtimeAsyncContinuationTimestamps, new Dictionary<object, long>(ReferenceEqualityComparer.Instance), null) ??
235Interlocked.CompareExchange(ref s_runtimeAsyncTaskTimestamps, new Dictionary<int, long>(), null) ??
1115if (Interlocked.CompareExchange(ref m_taskScheduler, scheduler, null) != null)
1215if (Interlocked.CompareExchange(ref m_taskScheduler, scheduler, null) != null)
1483Interlocked.CompareExchange(ref m_contingentProperties, new ContingentProperties(), null);
1637if (Interlocked.CompareExchange(ref contingentProps.m_completionEvent, newMre, null) != null)
1924if (Interlocked.CompareExchange(ref props.m_exceptionsHolder, holder, null) != null)
2319Interlocked.CompareExchange(ref props.m_exceptionalChildren, new List<Task>(), null);
System.Private.TypeLoader (5)
System.Private.Uri (3)
System.Private.Xml (5)
System.Private.Xml.Linq (3)
System.Reflection.Metadata (9)
System.Reflection.MetadataLoadContext (7)
System.Runtime.Caching (8)
System.Security.Cryptography (3)
System.Security.Cryptography.Pkcs (1)
System.Security.Principal.Windows (1)
System.ServiceModel.NetTcp (2)
System.ServiceModel.Primitives (2)
System.ServiceModel.UnixDomainSocket (2)
System.Text.Json (8)
System.Text.RegularExpressions (7)
System.Text.RegularExpressions.Generator (1)
System.Threading (2)
System.Threading.Channels (3)
System.Threading.RateLimiting (1)
System.Threading.Tasks.Dataflow (7)
System.Threading.Tasks.Parallel (3)
System.Transactions.Local (5)
System.Windows.Extensions (1)
System.Windows.Forms (1)
System.Xaml (17)
System\Xaml\XamlSchemaContext.cs (10)
374Interlocked.CompareExchange(ref _xmlNsCompatDict, CreateDictionary<string, string>(), null);
503Interlocked.CompareExchange(ref _masterBracketCharacterCache, CreateDictionary<XamlType, Dictionary<string, SpecialBracketCharacters>>(), null);
514Interlocked.CompareExchange(ref _masterTypeList, CreateDictionary<Type, XamlType>(ReferenceEqualityComparer.Instance), null);
525Interlocked.CompareExchange(ref _masterValueConverterList, CreateDictionary<ReferenceEqualityTuple<Type, XamlType, Type>, object>(), null);
536Interlocked.CompareExchange(ref _masterMemberList, CreateDictionary<ReferenceEqualityTuple<MemberInfo, MemberInfo>, XamlMember>(), null);
731Interlocked.CompareExchange(ref _xmlnsInfo, CreateDictionary<Assembly, XmlNsInfo>(ReferenceEqualityComparer.Instance), null);
742Interlocked.CompareExchange(ref _xmlnsInfoForDynamicAssemblies, CreateDictionary<WeakRefKey, XmlNsInfo>(), null);
754Interlocked.CompareExchange(ref _namespaceByUriList, CreateDictionary<string, XamlNamespace>(), null);
769Interlocked.CompareExchange(ref _xmlnsInfoForUnreferencedAssemblies, CreateDictionary<Assembly, XmlNsInfo>(ReferenceEqualityComparer.Instance), null);
1270Interlocked.CompareExchange(ref _referenceAssemblyNames, asmNames, null);