43 references to CompareExchange
Microsoft.CodeAnalysis (2)
Binding\UseSiteInfo.cs (2)
538Interlocked.CompareExchange(ref _info, info, Sentinel); 551info = Interlocked.CompareExchange(ref _info, info, null);
Microsoft.CodeAnalysis.CSharp (2)
FlowAnalysis\ControlFlowAnalysis.cs (2)
118Interlocked.CompareExchange(ref _regionEndPointIsReachable, endIsReachable, null); 119Interlocked.CompareExchange(ref _regionStartPointIsReachable, startIsReachable, null);
Microsoft.CodeAnalysis.VisualBasic (8)
Analysis\FlowAnalysis\ControlFlowAnalysis.vb (2)
98Interlocked.CompareExchange(_regionStartPointIsReachable, startPointIsReachable, Nothing) 99Interlocked.CompareExchange(_regionEndPointIsReachable, endPointIsReachable, Nothing)
Compilation\VisualBasicCompilation.vb (2)
257Interlocked.CompareExchange(_lazyMyTemplate, tree, VisualBasicSyntaxTree.Dummy) 276If Interlocked.CompareExchange(_lazyMyTemplate, tree, VisualBasicSyntaxTree.Dummy) Is VisualBasicSyntaxTree.Dummy Then
Declarations\MergedTypeDeclaration.vb (1)
179Interlocked.CompareExchange(_memberNames, names, Nothing)
Symbols\Source\SourceLambdaSymbol.vb (1)
60Dim oldValue As NamedTypeSymbol = Interlocked.CompareExchange(Me._lazyAnonymousDelegateSymbol, newValue, ErrorTypeSymbol.UnknownResultType)
Symbols\Source\SourceMethodSymbol.vb (1)
1303Interlocked.CompareExchange(_lazyMeParameter, New MeParameterSymbol(Me), Nothing)
Symbols\SynthesizedSymbols\SynthesizedMethodBase.vb (1)
183Interlocked.CompareExchange(_lazyMeParameter, New MeParameterSymbol(Me), Nothing)
Microsoft.Extensions.Options (1)
UnnamedOptionsManager.cs (1)
28lock (_syncObj ?? Interlocked.CompareExchange(ref _syncObj, new object(), null) ?? _syncObj)
Microsoft.ML.Data (1)
Deprecated\Instances\HeaderSchema.cs (1)
274Interlocked.CompareExchange(ref _lock, new object(), null);
System.ComponentModel.Composition (1)
System\ComponentModel\Composition\Primitives\Export.cs (1)
205Interlocked.CompareExchange(ref _exportedValue, exportedValue, Export._EmptyValue);
System.Diagnostics.DiagnosticSource (4)
System\Diagnostics\Metrics\AggregatorStore.cs (4)
141if (Interlocked.CompareExchange(ref _stateUnion, newState, null) is null) 158if (Interlocked.CompareExchange(ref _stateUnion, newState, state) == state) 177if (Interlocked.CompareExchange(ref _stateUnion, newState, null) is null) 194if (Interlocked.CompareExchange(ref _stateUnion, newState, state) == state)
System.Linq.Expressions (3)
System\Dynamic\Utils\ExpressionUtils.cs (2)
24Interlocked.CompareExchange( 71Interlocked.CompareExchange(
System\Linq\Expressions\BlockExpression.cs (1)
175Interlocked.CompareExchange(
System.Net.Http (1)
System\Net\Http\Headers\HttpHeaders.cs (1)
755object previousValue = Interlocked.CompareExchange(ref storeValueRef, info, value);
System.Net.HttpListener (1)
src\libraries\Common\src\System\Net\LazyAsyncResult.cs (1)
146if (Interlocked.CompareExchange(ref _event, waitHandle, null) == null)
System.Net.Mail (1)
src\libraries\Common\src\System\Net\LazyAsyncResult.cs (1)
146if (Interlocked.CompareExchange(ref _event, waitHandle, null) == null)
System.Net.Requests (1)
src\libraries\Common\src\System\Net\LazyAsyncResult.cs (1)
146if (Interlocked.CompareExchange(ref _event, waitHandle, null) == null)
System.Private.CoreLib (9)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (1)
2273Interlocked.CompareExchange(ref m_createEventLock, new object(), null);
src\libraries\System.Private.CoreLib\src\System\Threading\LazyInitializer.cs (1)
284Interlocked.CompareExchange(ref syncLock, new object(), null) ??
src\libraries\System.Private.CoreLib\src\System\Threading\ManualResetEventSlim.cs (1)
208Interlocked.CompareExchange(ref m_lock, new object(), null); // failure is benign. Someone else set the value.
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (5)
4569oldValue = Interlocked.CompareExchange(ref m_continuationObject, list, expected); 4626if ((m_continuationObject != null) || (Interlocked.CompareExchange(ref m_continuationObject, tc, null) != null)) 4650continuationsLocalRef = Interlocked.CompareExchange(ref m_continuationObject, new List<object?>(), continuationObject); 6101object? failedOrCanceled = Interlocked.CompareExchange(ref m_stateObject, completedTask, null); 6120failedOrCanceled = Interlocked.CompareExchange(ref m_stateObject, new List<Task> { first, completedTask }, first);
src\System\RuntimeType.CoreCLR.cs (1)
1675Interlocked.CompareExchange(ref s_methodInstantiationsLock!, new object(), null);
System.Runtime.Caching (1)
System\Runtime\Caching\ChangeMonitor.cs (1)
115Interlocked.CompareExchange(ref _onChangedState, state, s_NOT_SET);
System.Transactions.Local (6)
System\Transactions\TransactionTable.cs (5)
33Interlocked.CompareExchange(ref _syncRoot, new object(), null); 47Interlocked.CompareExchange(ref _writerFinishedEvent, new ManualResetEvent(true), null); 305WeakReference? oldNextSetWeak = (WeakReference?)Interlocked.CompareExchange( 334WeakReference? oldNextSetWeak = (WeakReference?)Interlocked.CompareExchange( 502(WeakReference?)Interlocked.CompareExchange(ref lastBucketSet.nextSetWeak, null, nextWeakSet);
System\Transactions\VolatileEnlistmentMultiplexing.cs (1)
69Interlocked.CompareExchange(ref s_classSyncObject, o, null);
System.Xaml (1)
System\Xaml\Schema\TypeBits.cs (1)
97Interlocked.CompareExchange(ref _value, newValue, null);