313 references to Exchange
aspire (1)
DotNet\ProcessExecution.cs (1)
560Interlocked.Exchange(ref _detachedUnixLauncherLease, null)?.Dispose();
Aspire.Dashboard (6)
Model\DimensionFilterViewModel.cs (2)
42Interlocked.Exchange(ref _selectedValues, Values.ToImmutableHashSet()); 65Interlocked.Exchange(ref _selectedValues, dimensionValues.ToImmutableHashSet());
ServiceClient\DashboardRunStore.cs (1)
595var runLock = Interlocked.Exchange(ref _runLock, null);
ServiceClient\TracingSqliteConnection.cs (1)
508private void CompleteActivity() => Interlocked.Exchange(ref _activity, null)?.Dispose();
Utils\AsyncLock.cs (1)
40Interlocked.Exchange(ref _semaphore, null)?.Release();
Utils\CancellationSeries.cs (1)
60using var priorCts = Interlocked.Exchange(ref _cts, next);
Aspire.Hosting (2)
IInteractionService.cs (1)
515var dispose = Interlocked.Exchange(ref _dispose, null);
Utils\ConcurrencyUtils.cs (1)
80var semaphores = Interlocked.Exchange(ref _semaphores, null);
GenerateDocumentationAndConfigFiles (10)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\SemaphoreSlimExtensions.cs (1)
55var semaphoreToDispose = Interlocked.Exchange(ref _semaphore, null);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+PrivateMarshal.cs (1)
31var dictionary = Interlocked.Exchange(ref Unsafe.AsRef(in location._dictionary), value._dictionary);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+PrivateMarshal.cs (1)
31var set = Interlocked.Exchange(ref Unsafe.AsRef(in location._set), value._set);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+PrivateMarshal.cs (1)
31var list = Interlocked.Exchange(ref Unsafe.AsRef(in location._list), value._list);
src\roslyn\src\Dependencies\Collections\TemporaryArray`1.cs (1)
156Interlocked.Exchange(ref _builder, null)?.Free();
src\roslyn\src\Dependencies\Threading\CancellationSeries.cs (1)
118var source = Interlocked.Exchange(ref _cts, null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.cs (1)
34return Interlocked.Exchange(ref s_currentLogger, logger);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CancellableLazy`1.cs (2)
58Interlocked.Exchange<Func<CancellationToken, T>?>(ref _valueFactory, null); 61Interlocked.Exchange(ref _gate, null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (1)
74var allLanguageServices = Interlocked.Exchange(ref _languageServicesMap, _languageServicesMap.Clear());
ILCompiler.TypeSystem (1)
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\Utilities\LockFreeReaderHashtable.cs (1)
286Interlocked.Exchange(ref _newHashTable, newHashTable);
Microsoft.AspNetCore.Components.Endpoints (1)
DependencyInjection\HotReloadService.cs (1)
39var current = Interlocked.Exchange(ref _tokenSource, new CancellationTokenSource());
Microsoft.AspNetCore.Components.WebAssembly (1)
Hosting\WebAssemblyHostConfiguration.cs (1)
132var previousToken = Interlocked.Exchange(ref _changeToken, new ConfigurationReloadToken());
Microsoft.AspNetCore.DataProtection (1)
KeyManagement\XmlKeyManager.cs (1)
487Interlocked.Exchange(ref _cacheExpirationTokenSource, new CancellationTokenSource())?.Cancel();
Microsoft.AspNetCore.Http.Connections (1)
Internal\HttpConnectionContext.cs (1)
1144var connection = Interlocked.Exchange(ref _connection, null);
Microsoft.AspNetCore.Mvc (1)
HotReloadService.cs (1)
78var current = Interlocked.Exchange(ref _tokenSource, new CancellationTokenSource());
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (1)
RedisOutputCacheStore.cs (1)
363ReleaseConnection(Interlocked.Exchange(ref _cache, null));
Microsoft.AspNetCore.Razor.Utilities.Shared (1)
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\Assumed_StringHandlers.cs (1)
140var builder = Interlocked.Exchange(ref _builder, null);
Microsoft.AspNetCore.Server.IIS (3)
Core\IO\AsyncIOEngine.cs (3)
222Interlocked.Exchange(ref _cachedAsyncReadOperation, null) ?? 226Interlocked.Exchange(ref _cachedAsyncWriteOperation, null) ?? 230Interlocked.Exchange(ref _cachedAsyncFlushOperation, null) ??
Microsoft.AspNetCore.Server.Kestrel.Core (2)
Internal\CertificatePathWatcher.cs (1)
203var previousToken = Interlocked.Exchange(ref _reloadToken, new());
Internal\Infrastructure\StreamCloseAwaitable.cs (1)
43Interlocked.Exchange(ref _callback, _callbackCompleted)?.Invoke();
Microsoft.AspNetCore.SignalR.Client.Core (1)
src\aspnetcore\src\SignalR\common\Shared\TimerAwaitable.cs (1)
76var continuation = Interlocked.Exchange(ref _callback, _callbackCompleted);
Microsoft.AspNetCore.SignalR.Core (2)
HubConnectionContext.cs (2)
202Interlocked.Exchange(ref _hubCallerContext, hubCallerContext); 902Interlocked.Exchange(ref _hubCallerContext, null);
Microsoft.Build (6)
Definition\ProjectCollection.cs (1)
984set => Interlocked.Exchange(ref _link, value)?.Disconnected(this);
Logging\BaseConsoleLogger.cs (1)
1207StringBuilder shared = Interlocked.Exchange(ref _sharedStringBuilder, null);
src\5057ed6cf5d6323b\ImmutableSegmentedDictionary`2+PrivateMarshal.cs (1)
31var dictionary = Interlocked.Exchange(ref Unsafe.AsRef(in location._dictionary), value._dictionary);
src\5057ed6cf5d6323b\ImmutableSegmentedHashSet`1+PrivateMarshal.cs (1)
31var set = Interlocked.Exchange(ref Unsafe.AsRef(in location._set), value._set);
src\5057ed6cf5d6323b\ImmutableSegmentedList`1+PrivateMarshal.cs (1)
31var list = Interlocked.Exchange(ref Unsafe.AsRef(in location._list), value._list);
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\TemporaryArray`1.cs (1)
155Interlocked.Exchange(ref _builder, null)?.Free();
Microsoft.Build.Framework (4)
BackEnd\InterningBinaryReader.cs (1)
195Buffer buffer = Interlocked.Exchange(ref s_bufferPool, null);
BuildException\BuildExceptionSerializationHelper.cs (1)
62if (Interlocked.Exchange(ref s_exceptionFactories, exceptionFactories) != null)
ReuseableStringBuilder.cs (2)
258StringBuilder? returned = Interlocked.Exchange(ref s_sharedBuilder, null); 339var oldSharedBuilder = Interlocked.Exchange(ref s_sharedBuilder, returningBuilder);
Microsoft.CodeAnalysis (11)
CommandLine\TouchedFileLogger.cs (2)
67var readFiles = Interlocked.Exchange( 92var writtenFiles = Interlocked.Exchange(
DiaSymReader\Writer\SymUnmanagedWriterImpl.cs (1)
104var symWriter = Interlocked.Exchange(ref _symWriter, null);
InternalUtilities\SemaphoreSlimExtensions.cs (1)
55var semaphoreToDispose = Interlocked.Exchange(ref _semaphore, null);
MetadataReference\AssemblyMetadata.cs (1)
375var previousData = Interlocked.Exchange(ref _lazyData, Data.Disposed);
MetadataReference\ModuleMetadata.cs (1)
296var onDispose = Interlocked.Exchange(ref _onDispose, null);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+PrivateMarshal.cs (1)
31var dictionary = Interlocked.Exchange(ref Unsafe.AsRef(in location._dictionary), value._dictionary);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+PrivateMarshal.cs (1)
31var set = Interlocked.Exchange(ref Unsafe.AsRef(in location._set), value._set);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+PrivateMarshal.cs (1)
31var list = Interlocked.Exchange(ref Unsafe.AsRef(in location._list), value._list);
src\roslyn\src\Dependencies\Collections\TemporaryArray`1.cs (1)
156Interlocked.Exchange(ref _builder, null)?.Free();
StrongName\StrongNameKeys.cs (1)
160Interlocked.Exchange(ref s_lastSeenKeyPair, cachedKeyPair);
Microsoft.CodeAnalysis.Analyzers (10)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\SemaphoreSlimExtensions.cs (1)
55var semaphoreToDispose = Interlocked.Exchange(ref _semaphore, null);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+PrivateMarshal.cs (1)
31var dictionary = Interlocked.Exchange(ref Unsafe.AsRef(in location._dictionary), value._dictionary);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+PrivateMarshal.cs (1)
31var set = Interlocked.Exchange(ref Unsafe.AsRef(in location._set), value._set);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+PrivateMarshal.cs (1)
31var list = Interlocked.Exchange(ref Unsafe.AsRef(in location._list), value._list);
src\roslyn\src\Dependencies\Collections\TemporaryArray`1.cs (1)
156Interlocked.Exchange(ref _builder, null)?.Free();
src\roslyn\src\Dependencies\Threading\CancellationSeries.cs (1)
118var source = Interlocked.Exchange(ref _cts, null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.cs (1)
34return Interlocked.Exchange(ref s_currentLogger, logger);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CancellableLazy`1.cs (2)
58Interlocked.Exchange<Func<CancellationToken, T>?>(ref _valueFactory, null); 61Interlocked.Exchange(ref _gate, null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (1)
74var allLanguageServices = Interlocked.Exchange(ref _languageServicesMap, _languageServicesMap.Clear());
Microsoft.CodeAnalysis.AnalyzerUtilities (9)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\SemaphoreSlimExtensions.cs (1)
55var semaphoreToDispose = Interlocked.Exchange(ref _semaphore, null);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+PrivateMarshal.cs (1)
31var dictionary = Interlocked.Exchange(ref Unsafe.AsRef(in location._dictionary), value._dictionary);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+PrivateMarshal.cs (1)
31var set = Interlocked.Exchange(ref Unsafe.AsRef(in location._set), value._set);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+PrivateMarshal.cs (1)
31var list = Interlocked.Exchange(ref Unsafe.AsRef(in location._list), value._list);
src\roslyn\src\Dependencies\Collections\TemporaryArray`1.cs (1)
156Interlocked.Exchange(ref _builder, null)?.Free();
src\roslyn\src\Dependencies\Threading\CancellationSeries.cs (1)
118var source = Interlocked.Exchange(ref _cts, null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.cs (1)
34return Interlocked.Exchange(ref s_currentLogger, logger);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CancellableLazy`1.cs (2)
58Interlocked.Exchange<Func<CancellationToken, T>?>(ref _valueFactory, null); 61Interlocked.Exchange(ref _gate, null);
Microsoft.CodeAnalysis.CodeStyle (9)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\SemaphoreSlimExtensions.cs (1)
55var semaphoreToDispose = Interlocked.Exchange(ref _semaphore, null);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+PrivateMarshal.cs (1)
31var dictionary = Interlocked.Exchange(ref Unsafe.AsRef(in location._dictionary), value._dictionary);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+PrivateMarshal.cs (1)
31var set = Interlocked.Exchange(ref Unsafe.AsRef(in location._set), value._set);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+PrivateMarshal.cs (1)
31var list = Interlocked.Exchange(ref Unsafe.AsRef(in location._list), value._list);
src\roslyn\src\Dependencies\Collections\TemporaryArray`1.cs (1)
156Interlocked.Exchange(ref _builder, null)?.Free();
src\roslyn\src\Dependencies\Threading\CancellationSeries.cs (1)
118var source = Interlocked.Exchange(ref _cts, null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.cs (1)
34return Interlocked.Exchange(ref s_currentLogger, logger);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CancellableLazy`1.cs (2)
58Interlocked.Exchange<Func<CancellationToken, T>?>(ref _valueFactory, null); 61Interlocked.Exchange(ref _gate, null);
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (1)
74var allLanguageServices = Interlocked.Exchange(ref _languageServicesMap, _languageServicesMap.Clear());
Microsoft.CodeAnalysis.CSharp (3)
Symbols\AliasSymbol.cs (1)
329bool won = Interlocked.Exchange(ref _aliasTargetDiagnostics, new StrongBox<ReadOnlyBindingDiagnostic<AssemblySymbol>>(newDiagnostics.ToReadOnlyAndFree(forceDiagnosticResolution: false))) == null;
Symbols\Metadata\PE\PENamedTypeSymbol.cs (1)
1931Interlocked.Exchange(ref _lazyMemberNames, memberNames);
Symbols\Metadata\PE\PENestedNamespaceSymbol.cs (1)
137Interlocked.Exchange(ref _typesByNS, null);
Microsoft.CodeAnalysis.CSharp.Features (1)
Completion\CSharpCompletionService.cs (1)
66Interlocked.Exchange(ref _latestRules, newRules);
Microsoft.CodeAnalysis.Extensions.Package (4)
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+PrivateMarshal.cs (1)
31var dictionary = Interlocked.Exchange(ref Unsafe.AsRef(in location._dictionary), value._dictionary);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+PrivateMarshal.cs (1)
31var set = Interlocked.Exchange(ref Unsafe.AsRef(in location._set), value._set);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+PrivateMarshal.cs (1)
31var list = Interlocked.Exchange(ref Unsafe.AsRef(in location._list), value._list);
src\roslyn\src\Dependencies\Collections\TemporaryArray`1.cs (1)
156Interlocked.Exchange(ref _builder, null)?.Free();
Microsoft.CodeAnalysis.Features (4)
Debugging\DebugInformationReaderProvider.cs (1)
89var symReader = Interlocked.Exchange(ref _symReader, null);
EditAndContinue\DebuggingSession.cs (3)
188if (Interlocked.Exchange(ref _pendingUpdate, null) != null) 202var previousPendingUpdate = Interlocked.Exchange(ref _pendingUpdate, update); 213var pendingUpdate = Interlocked.Exchange(ref _pendingUpdate, null);
Microsoft.CodeAnalysis.NetAnalyzers (2)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\PooledObjects\TemporaryDictionary`2.cs (1)
33Interlocked.Exchange(ref _storage, null)?.Free(cancellationToken);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\PooledObjects\TemporarySet`1.cs (1)
32Interlocked.Exchange(ref _storage, null)?.Free(cancellationToken);
Microsoft.CodeAnalysis.Razor.Compiler (4)
Language\TagHelperCollection.Builder.cs (2)
27var items = Interlocked.Exchange(ref _items, null!); 33var set = Interlocked.Exchange(ref _set, null!);
Language\TagHelperCollection.FixedSizeBuilder.cs (1)
38var set = Interlocked.Exchange(ref _set, null!);
Language\TagHelperCollection.RefBuilder.cs (1)
46var set = Interlocked.Exchange(ref _set, null!);
Microsoft.CodeAnalysis.ResxSourceGenerator (9)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\SemaphoreSlimExtensions.cs (1)
55var semaphoreToDispose = Interlocked.Exchange(ref _semaphore, null);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+PrivateMarshal.cs (1)
31var dictionary = Interlocked.Exchange(ref Unsafe.AsRef(in location._dictionary), value._dictionary);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+PrivateMarshal.cs (1)
31var set = Interlocked.Exchange(ref Unsafe.AsRef(in location._set), value._set);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+PrivateMarshal.cs (1)
31var list = Interlocked.Exchange(ref Unsafe.AsRef(in location._list), value._list);
src\roslyn\src\Dependencies\Collections\TemporaryArray`1.cs (1)
156Interlocked.Exchange(ref _builder, null)?.Free();
src\roslyn\src\Dependencies\Threading\CancellationSeries.cs (1)
118var source = Interlocked.Exchange(ref _cts, null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.cs (1)
34return Interlocked.Exchange(ref s_currentLogger, logger);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CancellableLazy`1.cs (2)
58Interlocked.Exchange<Func<CancellationToken, T>?>(ref _valueFactory, null); 61Interlocked.Exchange(ref _gate, null);
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\Metadata\PE\PENestedNamespaceSymbol.vb (1)
127Interlocked.Exchange(_typesByNS, Nothing)
Microsoft.CodeAnalysis.VisualBasic.Features (1)
Completion\VisualBasicCompletionService.vb (1)
69Interlocked.Exchange(_latestRules, newRules)
Microsoft.CodeAnalysis.Workspaces (12)
Shared\TestHooks\AsynchronousOperationListener.cs (1)
132var oldSource = Interlocked.Exchange(ref _expeditedDelayCancellationTokenSource, new CancellationTokenSource());
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\SemaphoreSlimExtensions.cs (1)
55var semaphoreToDispose = Interlocked.Exchange(ref _semaphore, null);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+PrivateMarshal.cs (1)
31var dictionary = Interlocked.Exchange(ref Unsafe.AsRef(in location._dictionary), value._dictionary);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+PrivateMarshal.cs (1)
31var set = Interlocked.Exchange(ref Unsafe.AsRef(in location._set), value._set);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+PrivateMarshal.cs (1)
31var list = Interlocked.Exchange(ref Unsafe.AsRef(in location._list), value._list);
src\roslyn\src\Dependencies\Collections\TemporaryArray`1.cs (1)
156Interlocked.Exchange(ref _builder, null)?.Free();
src\roslyn\src\Dependencies\Threading\CancellationSeries.cs (1)
118var source = Interlocked.Exchange(ref _cts, null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.cs (1)
34return Interlocked.Exchange(ref s_currentLogger, logger);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CancellableLazy`1.cs (2)
58Interlocked.Exchange<Func<CancellationToken, T>?>(ref _valueFactory, null); 61Interlocked.Exchange(ref _gate, null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (1)
74var allLanguageServices = Interlocked.Exchange(ref _languageServicesMap, _languageServicesMap.Clear());
Workspace\WorkspaceEventRegistration.cs (1)
33var eventMap = Interlocked.Exchange(ref _eventMap, null);
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\SemaphoreSlimExtensions.cs (1)
55var semaphoreToDispose = Interlocked.Exchange(ref _semaphore, null);
Microsoft.DiaSymReader (1)
Writer\SymUnmanagedWriterImpl.cs (1)
101var symWriter = Interlocked.Exchange(ref _symWriter, null);
Microsoft.DotNet.HotReload.Watch (4)
HotReload\HotReloadDotNetWatcher.cs (2)
85Interlocked.Exchange(ref forceRestartCancellationSource, new CancellationTokenSource())?.Dispose(); 342var changedPaths = Interlocked.Exchange(ref changedFilesAccumulator, []);
Process\RunningProcess.cs (1)
28var terminationSource = Interlocked.Exchange(ref _terminationSource, null);
src\sdk\src\Dotnet.Watch\AspireService\Helpers\SocketConnectionManager.cs (1)
28var connections = Interlocked.Exchange(ref _webSocketConnections, ImmutableDictionary<string, WebSocketConnection>.Empty);
Microsoft.DotNet.HotReload.WebAssembly.Browser (3)
src\sdk\src\Dotnet.Watch\HotReloadAgent\HotReloadAgent.cs (2)
125var handler = Interlocked.Exchange(ref _assemblyResolvingHandlerToInstall, null); 179var handler = Interlocked.Exchange(ref _hotReloadExceptionCreateHandler, null);
src\sdk\src\Dotnet.Watch\HotReloadAgent\MetadataUpdateHandlerInvoker.cs (1)
95=> Interlocked.Exchange(ref _actions, null);
Microsoft.Extensions.Caching.Hybrid (1)
Internal\RecyclableArrayBufferWriter.cs (1)
55RecyclableArrayBufferWriter<T> obj = Interlocked.Exchange(ref _spare, null) ?? new();
Microsoft.Extensions.Caching.Memory (2)
CacheEntry.CacheEntryTokens.cs (1)
117List<PostEvictionCallbackRegistration>? callbackRegistrations = Interlocked.Exchange(ref entry._tokens._postEvictionCallbacks, null);
MemoryCache.cs (1)
381CoherentState oldState = Interlocked.Exchange(ref _coherentState, new CoherentState());
Microsoft.Extensions.Caching.StackExchangeRedis (1)
RedisCache.cs (1)
624ReleaseConnection(Interlocked.Exchange(ref _cache, null));
Microsoft.Extensions.Configuration (3)
ConfigurationManager.cs (1)
119var previousToken = Interlocked.Exchange(ref _changeToken, new ConfigurationReloadToken());
ConfigurationProvider.cs (1)
117ConfigurationReloadToken previousToken = Interlocked.Exchange(ref _reloadToken, new ConfigurationReloadToken());
ConfigurationRoot.cs (1)
94ConfigurationReloadToken previousToken = Interlocked.Exchange(ref _changeToken, new ConfigurationReloadToken());
Microsoft.Extensions.DotNetDeltaApplier (3)
src\sdk\src\Dotnet.Watch\HotReloadAgent\HotReloadAgent.cs (2)
125var handler = Interlocked.Exchange(ref _assemblyResolvingHandlerToInstall, null); 179var handler = Interlocked.Exchange(ref _hotReloadExceptionCreateHandler, null);
src\sdk\src\Dotnet.Watch\HotReloadAgent\MetadataUpdateHandlerInvoker.cs (1)
95=> Interlocked.Exchange(ref _actions, null);
Microsoft.Extensions.Logging.EventSource (1)
LoggingEventSource.cs (1)
408CancellationTokenSource? tcs = Interlocked.Exchange(ref _cancellationTokenSource, null);
Microsoft.Extensions.ML (6)
ModelLoaders\FileModelLoader.cs (1)
72var previousToken = Interlocked.Exchange(ref _reloadToken, new ModelReloadToken());
ModelLoaders\UriModelLoader.cs (1)
85var previousToken = Interlocked.Exchange(ref _reloadToken, new ModelReloadToken());
PoolLoader.cs (4)
108var oldPool = Interlocked.Exchange(ref _pool, newPool); 109var oldModel = Interlocked.Exchange(ref _model, model); 141var pool = Interlocked.Exchange(ref _pool, null); 142var model = Interlocked.Exchange(ref _model, null);
Microsoft.Extensions.ML.Tests (1)
PredictionEnginePoolTests.cs (1)
142var previous = Interlocked.Exchange(ref _token, new ModelReloadToken());
Microsoft.Extensions.Primitives (1)
ChangeToken.cs (1)
164Interlocked.Exchange(ref _disposable, _disposedSentinel)?.Dispose();
Microsoft.Extensions.ServiceDiscovery (1)
ServiceEndpointWatcher.cs (1)
209Interlocked.Exchange(ref _cachedEndpoints, null);
Microsoft.Maui (1)
Platform\ActionDisposable.cs (1)
18 Interlocked.Exchange(ref _action, null)?.Invoke();
Microsoft.Maui.Controls (2)
ImageSource.cs (1)
129 TaskCompletionSource<bool> tcs = Interlocked.Exchange(ref _completionSource, null);
Shell\ShellNavigatingDeferral.cs (1)
21 var taskToComplete = Interlocked.Exchange(ref _completed, null);
Microsoft.Maui.Graphics.Skia (1)
SkiaImage.cs (1)
143 var previousValue = Interlocked.Exchange(ref _image, null);
Microsoft.Maui.Graphics.Win2D.WinUI.Desktop (1)
src\Graphics\src\Graphics\Platforms\Windows\PlatformImage.cs (1)
46 var bitmap = Interlocked.Exchange(ref _bitmap, null);
Microsoft.ML.Core (2)
Environment\ConsoleEnvironment.cs (1)
448_oldConsoleWriter = Interlocked.Exchange(ref _root._consoleWriter, _newConsoleWriter);
Utilities\Contracts.cs (1)
239return Interlocked.Exchange(ref _handler, handler);
Microsoft.ML.CpuMath (1)
src\Microsoft.ML.Core\Utilities\Contracts.cs (1)
239return Interlocked.Exchange(ref _handler, handler);
Microsoft.TestPlatform.CommunicationUtilities (1)
TestRequestSender.cs (1)
207var handler = Interlocked.Exchange(ref _onDisconnected, null);
MSBuild.Coordinator (1)
CoordinatorServer.cs (1)
597Interlocked.Exchange(ref _shutdownTimer, newTimer)?.Dispose();
NuGet.Protocol (2)
HttpSource\HttpSource.cs (1)
516Interlocked.Exchange(ref _throttle, null)?.Release();
Plugins\PluginManager.cs (1)
45Lazy<IPluginManager> previous = System.Threading.Interlocked.Exchange(ref _lazy, new Lazy<IPluginManager>(() => new PluginManager()));
PresentationFramework (3)
MS\Internal\Data\CollectionViewProxy.cs (1)
169IndexedEnumerable indexer = (IndexedEnumerable)Interlocked.Exchange(ref _indexer, null);
MS\Internal\Data\DataBindEngine.cs (1)
615HybridDictionary asyncDispatchers = (HybridDictionary)Interlocked.Exchange(ref _asyncDispatchers, null);
System\Windows\Data\CollectionView.cs (1)
1427IndexedEnumerable wrapper = (IndexedEnumerable) Interlocked.Exchange(ref _enumerableWrapper, null);
Roslyn.Diagnostics.Analyzers (10)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\SemaphoreSlimExtensions.cs (1)
55var semaphoreToDispose = Interlocked.Exchange(ref _semaphore, null);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+PrivateMarshal.cs (1)
31var dictionary = Interlocked.Exchange(ref Unsafe.AsRef(in location._dictionary), value._dictionary);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+PrivateMarshal.cs (1)
31var set = Interlocked.Exchange(ref Unsafe.AsRef(in location._set), value._set);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+PrivateMarshal.cs (1)
31var list = Interlocked.Exchange(ref Unsafe.AsRef(in location._list), value._list);
src\roslyn\src\Dependencies\Collections\TemporaryArray`1.cs (1)
156Interlocked.Exchange(ref _builder, null)?.Free();
src\roslyn\src\Dependencies\Threading\CancellationSeries.cs (1)
118var source = Interlocked.Exchange(ref _cts, null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.cs (1)
34return Interlocked.Exchange(ref s_currentLogger, logger);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CancellableLazy`1.cs (2)
58Interlocked.Exchange<Func<CancellationToken, T>?>(ref _valueFactory, null); 61Interlocked.Exchange(ref _gate, null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\MefWorkspaceServices.cs (1)
74var allLanguageServices = Interlocked.Exchange(ref _languageServicesMap, _languageServicesMap.Clear());
rzc (1)
Json\Assumed_StringHandlers.cs (1)
133var builder = Interlocked.Exchange(ref _builder, null);
System.Collections.Concurrent (2)
System\Collections\Concurrent\ConcurrentBag.cs (2)
723Interlocked.Exchange(ref _currentOp, Operation.Add); 746Interlocked.Exchange(ref _currentOp, Operation.Add); // ensure subsequent reads aren't reordered before this
System.Collections.Immutable (1)
System\Collections\Immutable\ImmutableInterlocked.cs (1)
205return new ImmutableArray<T>(Interlocked.Exchange(ref Unsafe.AsRef(in location.array), value.array));
System.Data.OleDb (3)
OleDbCommand.cs (1)
552UnsafeNativeMethods.ICommandText? ict = Interlocked.Exchange(ref _icommandText, null);
System\Data\ProviderBase\DbConnectionInternal.cs (1)
146Interlocked.Exchange(ref _enlistedTransaction, null)?.Dispose();
System\Data\ProviderBase\DbConnectionInternal.Shared.cs (1)
123previousTransactionClone = Interlocked.Exchange(ref _enlistedTransaction, valueClone);
System.Diagnostics.DiagnosticSource (2)
System\Diagnostics\ActivitySource.cs (1)
374if (Interlocked.Exchange(ref _listeners, s_disposedListeners) != s_disposedListeners)
System\Diagnostics\DiagnosticListener.cs (1)
190subscriber = Interlocked.Exchange(ref _subscriptions, subscriber);
System.Diagnostics.Process (1)
System\Diagnostics\Process.Multiplexing.cs (1)
586if (Interlocked.Exchange(ref firstCompleted, true))
System.Formats.Cbor (1)
System\Formats\Cbor\Reader\CborReader.String.cs (1)
524List<(int Offset, int Length)>? ranges = Interlocked.Exchange(ref _indefiniteLengthStringRangeAllocation, null);
System.IO.Compression (4)
System\IO\Compression\DeflateZLib\DeflateStream.cs (1)
1131if (Interlocked.Exchange(ref _activeAsyncOperation, true))
System\IO\Compression\Zstandard\ZstandardStream.cs (3)
227if (!Interlocked.Exchange(ref _activeRwOperation, true)) 245if (Interlocked.Exchange(ref _activeRwOperation, true)) 260Interlocked.Exchange(ref _activeRwOperation, false);
System.IO.Compression.Brotli (1)
System\IO\Compression\BrotliStream.cs (1)
218if (Interlocked.Exchange(ref _activeAsyncOperation, true))
System.IO.Pipes (1)
System\IO\Pipes\NamedPipeServerStream.Unix.cs (1)
138Interlocked.Exchange(ref _instance, null)?.Dispose(disposing); // interlocked to avoid shared state problems from erroneous double/concurrent disposes
System.Linq.Expressions (1)
System\Runtime\CompilerServices\CallSite.cs (1)
190matchmaker = Interlocked.Exchange(ref _cachedMatchmaker, null);
System.Linq.Parallel (2)
System\Linq\Parallel\Channels\AsynchronousChannel.cs (2)
344Interlocked.Exchange(ref _producerIsWaiting, true); 561Interlocked.Exchange(ref _consumerIsWaiting, true);
System.Net.Http (10)
System\Net\Http\HttpClient.cs (1)
702CancellationTokenSource currentCts = Interlocked.Exchange(ref _pendingRequestsCts, new CancellationTokenSource());
System\Net\Http\SocketsHttpHandler\Http2Stream.cs (1)
1575Http2Stream? http2Stream = Interlocked.Exchange(ref _http2Stream, null);
System\Net\Http\SocketsHttpHandler\Http3Connection.cs (3)
643if (Interlocked.Exchange(ref _haveServerControlStream, true)) 656if (Interlocked.Exchange(ref _haveServerQpackDecodeStream, true)) 667if (Interlocked.Exchange(ref _haveServerQpackEncodeStream, true))
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (2)
1465Http3RequestStream? stream = Interlocked.Exchange(ref _stream, null); 1492Http3RequestStream? stream = Interlocked.Exchange(ref _stream, null);
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (1)
101if (!Interlocked.Exchange(ref _disposed, true))
System\Net\Http\SocketsHttpHandler\HttpConnectionBase.cs (1)
264if (Interlocked.Exchange(ref _evictionCallbackInProgress, true) ||
System\Net\Http\SocketsHttpHandler\HttpContentReadStream.cs (1)
55if (Interlocked.Exchange(ref _disposed, true))
System.Net.Mail (2)
System\Net\Mail\SmtpClient.cs (2)
436if (Interlocked.Exchange(ref _inCall, true)) 631CancellationTokenSource currentCts = Interlocked.Exchange(ref _pendingSendCts, new CancellationTokenSource());
System.Net.Quic (5)
src\runtime\src\libraries\Common\src\System\Net\StreamBuffer.cs (2)
315if (Interlocked.Exchange(ref _hasWaiter, false)) 325if (Interlocked.Exchange(ref _hasWaiter, false))
System\Net\Quic\QuicConnection.cs (1)
822if (Interlocked.Exchange(ref _disposed, true))
System\Net\Quic\QuicListener.cs (1)
410if (Interlocked.Exchange(ref _disposed, true))
System\Net\Quic\QuicStream.cs (1)
756if (Interlocked.Exchange(ref _disposed, true))
System.Net.Requests (8)
System\Net\HttpWebRequest.cs (7)
998if (Interlocked.Exchange(ref _abortCalled, true)) 1150if (Interlocked.Exchange(ref _beginGetRequestStreamCalled, true)) 1155Interlocked.Exchange(ref _endGetRequestStreamCalled, false); 1174if (Interlocked.Exchange(ref _endGetRequestStreamCalled, true)) 1189Interlocked.Exchange(ref _beginGetRequestStreamCalled, false); 1427if (Interlocked.Exchange(ref _beginGetResponseCalled, true)) 1447if (Interlocked.Exchange(ref _endGetResponseCalled, true))
System\Net\TimerThread.cs (1)
455internal override bool Cancel() => !Interlocked.Exchange(ref _canceled, true);
System.Net.Security (12)
src\runtime\src\libraries\Common\src\System\Net\Security\SSPIHandleCache.cs (1)
30Interlocked.Exchange(ref s_cacheSlots[index], newRef)?.Dispose();
System\Net\Security\NegotiateStream.cs (3)
340if (Interlocked.Exchange(ref _readInProgress, true)) 514if (Interlocked.Exchange(ref _writeInProgress, true)) 733if (Interlocked.Exchange(ref _authInProgress, true))
System\Net\Security\SslStream.cs (2)
736var manager = Interlocked.Exchange(ref field, null) ?? new PoolingPointerMemoryManager(); 751if (Interlocked.Exchange(ref _nestedRead, NestedState.StreamInUse) == NestedState.StreamInUse)
System\Net\Security\SslStream.IO.cs (6)
66if (Interlocked.Exchange(ref _nestedRead, NestedState.StreamDisposed) == NestedState.StreamNotInUse && 67Interlocked.Exchange(ref _nestedAuth, NestedState.StreamDisposed) == NestedState.StreamNotInUse) 81if (Interlocked.Exchange(ref _connectionOpenedStatus, ConnectionStatus.Disposed) == ConnectionStatus.HandshakeCompleted) 190if (Interlocked.Exchange(ref _nestedWrite, NestedState.StreamInUse) != NestedState.StreamNotInUse) 274if (Interlocked.Exchange(ref _nestedAuth, NestedState.StreamInUse) == NestedState.StreamInUse) 1054if (Interlocked.Exchange(ref _nestedWrite, NestedState.StreamInUse) == NestedState.StreamInUse)
System.Net.Sockets (30)
System\Net\Sockets\NetworkStream.cs (1)
390if (Interlocked.Exchange(ref _disposed, true))
System\Net\Sockets\SafeSocketHandle.cs (1)
57private bool TryOwnClose() => !Interlocked.Exchange(ref _ownClose, true);
System\Net\Sockets\Socket.cs (1)
3417if (Interlocked.Exchange(ref _disposed, true))
System\Net\Sockets\Socket.Tasks.cs (18)
62Interlocked.Exchange(ref _singleBufferSendEventArgs, null) ?? 95Interlocked.Exchange(ref _singleBufferReceiveEventArgs, null) ?? 240Interlocked.Exchange(ref _singleBufferSendEventArgs, null) ?? 298Interlocked.Exchange(ref _singleBufferReceiveEventArgs, null) ?? 326TaskSocketAsyncEventArgs<int>? saea = Interlocked.Exchange(ref _multiBufferReceiveEventArgs, null); 388Interlocked.Exchange(ref _singleBufferReceiveEventArgs, null) ?? 428Interlocked.Exchange(ref _singleBufferReceiveEventArgs, null) ?? 489Interlocked.Exchange(ref _singleBufferReceiveEventArgs, null) ?? 544Interlocked.Exchange(ref _singleBufferSendEventArgs, null) ?? 562Interlocked.Exchange(ref _singleBufferSendEventArgs, null) ?? 590TaskSocketAsyncEventArgs<int>? saea = Interlocked.Exchange(ref _multiBufferSendEventArgs, null); 652Interlocked.Exchange(ref _singleBufferSendEventArgs, null) ?? 682Interlocked.Exchange(ref _singleBufferSendEventArgs, null) ?? 760Interlocked.Exchange(ref _singleBufferSendEventArgs, null) ?? 932Interlocked.Exchange(ref _multiBufferReceiveEventArgs, null)?.Dispose(); 933Interlocked.Exchange(ref _multiBufferSendEventArgs, null)?.Dispose(); 934Interlocked.Exchange(ref _singleBufferReceiveEventArgs, null)?.Dispose(); 935Interlocked.Exchange(ref _singleBufferSendEventArgs, null)?.Dispose();
System\Net\Sockets\SocketAsyncContext.Unix.cs (6)
92Interlocked.Exchange(ref _cachedAcceptOperation, null) ?? 96Interlocked.Exchange(ref _cachedBufferMemoryReceiveOperation, null) ?? 100Interlocked.Exchange(ref _cachedBufferListReceiveOperation, null) ?? 104Interlocked.Exchange(ref _cachedBufferMemorySendOperation, null) ?? 108Interlocked.Exchange(ref _cachedBufferListSendOperation, null) ?? 258Debug.Assert(!Interlocked.Exchange(ref _callbackQueued, true), $"Unexpected _callbackQueued: {_callbackQueued}");
System\Net\Sockets\SocketAsyncEventArgs.cs (2)
940public bool ReachedCoordinationPointFirst() => !Interlocked.Exchange(ref _isCompleted, true); 953public bool Finished() => Interlocked.Exchange(ref _isCompleted, true);
System\Net\Sockets\TCPClient.cs (1)
264if (!Interlocked.Exchange(ref _disposed, true))
System.Net.WebSockets.Client (1)
System\Net\WebSockets\ClientWebSocket.cs (1)
191if (Interlocked.Exchange(ref _state, InternalState.Disposed) != InternalState.Disposed)
System.Private.CoreLib (22)
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\Utilities\LockFreeReaderHashtable.cs (1)
286Interlocked.Exchange(ref _newHashTable, newHashTable);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\Utilities\LockFreeReaderHashtableOfPointers.cs (1)
252Interlocked.Exchange(ref _newHashTable, newHashTable);
src\runtime\src\libraries\System.Private.CoreLib\src\Microsoft\Win32\SafeHandles\SafeFileHandle.ThreadPoolValueTaskSource.cs (1)
23Interlocked.Exchange(ref _reusableThreadPoolValueTaskSource, null) ?? new ThreadPoolValueTaskSource(this);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\SharedArrayPool.cs (3)
232if (Interlocked.Exchange(ref buckets[i].Array, null) is T[] buffer) 273if (Interlocked.Exchange(ref buckets[i].Array, null) is T[] buffer && 294if (!Interlocked.Exchange(ref _trimCallbackCreated, true))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Debug.cs (1)
28return Interlocked.Exchange(ref s_provider, provider);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\ActivityTracker.cs (1)
187if (!Interlocked.Exchange(ref activityToStop.m_stopped, true))
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEnumerable.cs (1)
47return Interlocked.Exchange(ref _enumerator, null) ?? new DelegateEnumerator(this, isNormalized: false);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\ConditionalWeakTable.cs (1)
423ConditionalWeakTable<TKey, TValue>? table = Interlocked.Exchange(ref _table, null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\PoolingAsyncValueTaskMethodBuilderT.cs (1)
341(box = Interlocked.Exchange<StateMachineBox<TStateMachine>?>(ref slot, null)) is null)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyLoadContext.cs (1)
132Interlocked.Exchange(ref _unloading, null!)?.Invoke(this);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenSource.cs (5)
562ManualResetEvent? mre = Interlocked.Exchange<ManualResetEvent?>(ref _kernelEvent!, null); 735Registrations? registrations = Interlocked.Exchange(ref _registrations, null); 738Interlocked.Exchange(ref _state, States.NotifyingCompleteState); 1159if (Interlocked.Exchange(ref value, true)) 1167do { sw.SpinOnce(); } while (Interlocked.Exchange(ref value, true));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ReaderWriterLockSlim.cs (1)
1539return !Interlocked.Exchange(ref _isLocked, true);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\RegisteredWaitHandle.Portable.cs (1)
76Interlocked.Exchange(ref s_cachedEvent, null) ??
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Sources\ManualResetValueTaskSourceCore.cs (1)
235Action<object?>? continuation = Interlocked.Exchange(ref _continuation, ManualResetValueTaskSourceCoreShared.s_sentinel);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (1)
6833if ((task1 = Interlocked.Exchange(ref _task1, null)) != null)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolWorkQueue.cs (1)
1179Debug.Assert(!Interlocked.Exchange(ref _executed, true), "A QueueUserWorkItemCallback was called twice!");
System.Reflection.Metadata (6)
System\Reflection\Internal\MemoryBlocks\ByteArrayMemoryProvider.cs (1)
26Interlocked.Exchange(ref _pinned, null)?.Dispose();
System\Reflection\Internal\MemoryBlocks\MemoryMappedFileBlock.cs (2)
50Interlocked.Exchange(ref _safeBuffer, null)?.ReleasePointer(); 51Interlocked.Exchange(ref _accessor, null)?.Dispose();
System\Reflection\Internal\MemoryBlocks\StreamMemoryBlockProvider.cs (2)
54Interlocked.Exchange(ref _stream, null!)?.Dispose(); 57Interlocked.Exchange(ref _lazyMemoryMap, null)?.Dispose();
System\Reflection\Metadata\Internal\VirtualHeap.cs (1)
56var blobs = Interlocked.Exchange(ref _blobs, null);
System.Runtime.InteropServices (1)
System\Runtime\InteropServices\Marshalling\ComObject.cs (1)
86if (UniqueInstance && !Interlocked.Exchange(ref _released, true))
System.Security.Cryptography (2)
System\Security\Cryptography\HashProviderCng.cs (1)
167SafeBCryptHashHandle? previousHash = Interlocked.Exchange(ref _hHash, hHash);
System\Security\Cryptography\RSABCrypt.cs (1)
67SafeBCryptKeyHandle? oldKey = Interlocked.Exchange(ref _key, newKey);
System.Text.Json (3)
System\Text\Json\Document\JsonDocument.cs (2)
74byte[]? extraRentedBytes = Interlocked.Exchange<byte[]?>(ref _extraRentedArrayPoolBytes, null); 86PooledByteBufferWriter? extraBufferWriter = Interlocked.Exchange<PooledByteBufferWriter?>(ref _extraPooledByteBufferWriter, null);
System\Text\Json\Document\JsonDocument.MetadataDb.cs (1)
153byte[]? data = Interlocked.Exchange(ref _data, null!);
System.Text.RegularExpressions (3)
System\Text\RegularExpressions\Regex.cs (3)
574RegexRunner runner = Interlocked.Exchange(ref _runner, null) ?? CreateRunner(); 619RegexRunner runner = Interlocked.Exchange(ref _runner, null) ?? CreateRunner(); 682RegexRunner runner = Interlocked.Exchange(ref _runner, null) ?? CreateRunner();
System.Threading.Channels (1)
System\Threading\Channels\AsyncOperation.cs (1)
184!Interlocked.Exchange(ref _completionReserved, true);
System.Threading.RateLimiting (1)
System\Threading\RateLimiting\TimerAwaitable.cs (1)
89Action? continuation = Interlocked.Exchange(ref _callback, _callbackCompleted);
System.Threading.Tasks.Dataflow (1)
Internal\SpscTargetCore.cs (1)
255Task? previousConsumer = Interlocked.Exchange<Task?>(ref _activeConsumer, null);
System.Threading.Tasks.Parallel (1)
System\Threading\Tasks\ParallelRangeManager.cs (1)
160Interlocked.Exchange(ref _indexRanges[_nCurrentIndexRange]._bRangeFinished, true);
System.Transactions.Local (1)
System\Transactions\DtcProxyShim\EnlistmentNotifyShim.cs (1)
38ITransactionEnlistmentAsync? pEnlistmentAsync = Interlocked.Exchange(ref EnlistmentAsync, null);
System.Windows.Forms (1)
System\Windows\Forms\SystemVisualSettingsTracker.cs (1)
124Interlocked.Exchange(ref s_currentSettings, currentSettings);
System.Windows.Forms.Primitives (2)
System\Windows\Forms\ObjectCache.cs (2)
32item = Interlocked.Exchange(ref _itemsCache[i], null); 51temp = Interlocked.Exchange(ref _itemsCache[i], temp);