223 references to CompareExchange
Aspire.Dashboard (2)
Aspire.Hosting (1)
dotnet-svcutil-lib (12)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\WebSocketTransportDuplexSessionChannel.cs (7)
330if (Interlocked.CompareExchange(ref _cleanupStatus, WebSocketHelper.OperationFinished, WebSocketHelper.OperationNotStarted) == WebSocketHelper.OperationNotStarted)
510if (Interlocked.CompareExchange(ref _asyncReceiveState, AsyncReceiveState.Cancelled, AsyncReceiveState.Started) == AsyncReceiveState.Started)
725int currentState = Interlocked.CompareExchange(ref _asyncReceiveState, AsyncReceiveState.Started, AsyncReceiveState.Finished);
806if (Interlocked.CompareExchange(ref _asyncReceiveState, AsyncReceiveState.Finished, AsyncReceiveState.Started) == AsyncReceiveState.Started)
1181if (Interlocked.CompareExchange(ref _endOfMessageWritten, WebSocketHelper.OperationFinished, WebSocketHelper.OperationNotStarted) == WebSocketHelper.OperationNotStarted)
1259if (Interlocked.CompareExchange(ref _messageSourceCleanState, WebSocketHelper.OperationFinished, WebSocketHelper.OperationNotStarted) == WebSocketHelper.OperationNotStarted)
1301if (Interlocked.CompareExchange(ref _endOfMessageWritten, WebSocketHelper.OperationFinished, WebSocketHelper.OperationNotStarted) == WebSocketHelper.OperationNotStarted)
GenerateDocumentationAndConfigFiles (2)
Metrics (2)
Metrics.Legacy (2)
Microsoft.AspNetCore.Server.Kestrel.Core (2)
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (1)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (1)
Microsoft.AspNetCore.SignalR.Core (1)
Microsoft.CodeAnalysis (7)
Microsoft.CodeAnalysis.Analyzers (2)
Microsoft.CodeAnalysis.AnalyzerUtilities (3)
Microsoft.CodeAnalysis.BannedApiAnalyzers (2)
Microsoft.CodeAnalysis.CodeStyle (2)
Microsoft.CodeAnalysis.CSharp (10)
Microsoft.CodeAnalysis.EditorFeatures (1)
Microsoft.CodeAnalysis.LanguageServer (1)
Microsoft.CodeAnalysis.LanguageServer.UnitTests (1)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (2)
Microsoft.CodeAnalysis.PublicApiAnalyzers (2)
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Microsoft.CodeAnalysis.ResxSourceGenerator (2)
Microsoft.CodeAnalysis.Scripting (1)
Microsoft.CodeAnalysis.VisualBasic (8)
Microsoft.CodeAnalysis.Workspaces (4)
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (4)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (1)
Microsoft.DotNet.RemoteExecutor (1)
Microsoft.Extensions.Caching.Hybrid (1)
Microsoft.Extensions.Caching.Memory (1)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (1)
Microsoft.Extensions.Http.Diagnostics (1)
Microsoft.Extensions.Telemetry (1)
Microsoft.Extensions.TimeProvider.Testing (1)
Microsoft.ML.AutoML.Interactive (1)
Microsoft.ML.Data (1)
Microsoft.NET.StringTools (1)
Microsoft.VisualStudio.LanguageServices (1)
Microsoft.VisualStudio.LanguageServices.Implementation (1)
Roslyn.Diagnostics.Analyzers (2)
System.Collections.Concurrent (2)
System.ComponentModel.Composition (10)
System.ComponentModel.Composition.Registration (3)
System.Configuration.ConfigurationManager (1)
System.Console (1)
System.Data.Odbc (1)
System.Diagnostics.DiagnosticSource (1)
System.Drawing.Common (3)
System.Net.Http (1)
System.Net.HttpListener (3)
System.Net.Quic (6)
System.Net.Requests (7)
System.Net.Security (2)
System.Private.CoreLib (29)
src\libraries\System.Private.CoreLib\src\System\Threading\Interlocked.cs (5)
408(uint)CompareExchange(ref Unsafe.As<uint, int>(ref location1), (int)value, (int)comparand);
430=> Unsafe.BitCast<int, float>(CompareExchange(ref Unsafe.As<float, int>(ref location1), Unsafe.BitCast<float, int>(value), Unsafe.BitCast<float, int>(comparand)));
528CompareExchange(
589int oldValue = CompareExchange(ref location1, newValue, current);
655int oldValue = CompareExchange(ref location1, newValue, current);
System.Private.Xml.Linq (4)
System.Runtime.Caching (3)
System.Security.Cryptography (1)
System.ServiceModel.Http (8)
System\ServiceModel\Channels\WebSocketTransportDuplexSessionChannel.cs (7)
309if (Interlocked.CompareExchange(ref _cleanupStatus, WebSocketHelper.OperationFinished, WebSocketHelper.OperationNotStarted) == WebSocketHelper.OperationNotStarted)
494if (Interlocked.CompareExchange(ref _asyncReceiveState, AsyncReceiveState.Cancelled, AsyncReceiveState.Started) == AsyncReceiveState.Started)
697int currentState = Interlocked.CompareExchange(ref _asyncReceiveState, AsyncReceiveState.Started, AsyncReceiveState.Finished);
778if (Interlocked.CompareExchange(ref _asyncReceiveState, AsyncReceiveState.Finished, AsyncReceiveState.Started) == AsyncReceiveState.Started)
1153if (Interlocked.CompareExchange(ref _endOfMessageWritten, WebSocketHelper.OperationFinished, WebSocketHelper.OperationNotStarted) == WebSocketHelper.OperationNotStarted)
1231if (Interlocked.CompareExchange(ref _messageSourceCleanState, WebSocketHelper.OperationFinished, WebSocketHelper.OperationNotStarted) == WebSocketHelper.OperationNotStarted)
1273if (Interlocked.CompareExchange(ref _endOfMessageWritten, WebSocketHelper.OperationFinished, WebSocketHelper.OperationNotStarted) == WebSocketHelper.OperationNotStarted)
System.ServiceModel.Primitives (12)
Internals\System\Runtime\IOThreadScheduler.cs (8)
186if (slot == (slot = Interlocked.CompareExchange(ref _headTail, Bits.IncrementLo(slot), slot)))
210if (slot == (slot = Interlocked.CompareExchange(ref _headTail, Bits.IncrementLo(slot), slot)))
330Interlocked.CompareExchange(ref _gate, 0, gateSnapshot);
357Interlocked.CompareExchange(ref _gate, 0, gateSnapshot) != gateSnapshot)
362Interlocked.CompareExchange(ref _gate, 0, gateSnapshot);
396Interlocked.CompareExchange(ref _gate, 0, gateSnapshot) != gateSnapshot)
401Interlocked.CompareExchange(ref _gate, 0, gateSnapshot);
413Interlocked.CompareExchange(ref _gate, 0, gateSnapshot);
System.Text.Json (2)
System.Text.RegularExpressions.Generator (1)
System.Threading (15)
System\Threading\ReaderWriterLock.cs (12)
85if (Interlocked.CompareExchange(ref _state, LockStates.Reader, 0) == 0)
132currentState = Interlocked.CompareExchange(ref _state, knownState + LockStates.Reader, knownState);
186currentState = Interlocked.CompareExchange(ref _state, knownState + LockStates.WaitingReader, knownState);
287if (Interlocked.CompareExchange(ref _state, LockStates.Writer, 0) == 0)
313currentState = Interlocked.CompareExchange(ref _state, knownState + LockStates.Writer, knownState);
356currentState = Interlocked.CompareExchange(ref _state, knownState + LockStates.WaitingWriter, knownState);
533currentState = Interlocked.CompareExchange(ref _state, knownState + modifyState, knownState);
641currentState = Interlocked.CompareExchange(ref _state, knownState + modifyState, knownState);
702int knownState = Interlocked.CompareExchange(ref _state, LockStates.Writer, LockStates.Reader);
811currentState = Interlocked.CompareExchange(ref _state, knownState + modifyState, knownState);
941if (Interlocked.CompareExchange(ref _state, LockStates.Writer, 0) == 0)
958Interlocked.CompareExchange(ref _state, knownState + LockStates.Reader, knownState) == knownState)
System.Threading.RateLimiting (2)
System.Threading.Tasks.Dataflow (4)
System.Threading.Tasks.Parallel (1)
System.Xaml (1)
Test.Utilities (2)
Text.Analyzers (2)