134 references to Exchange
mscorlib (10)
parent\parent\parent\parent\InternalApis\NDP_Common\inc\PinnableBufferCache.cs (1)
122int previousNumAllocCalls = Interlocked.Exchange(ref m_numAllocCalls, 0);
system\threading\CancellationTokenSource.cs (1)
765Interlocked.Exchange(ref m_state, NOTIFYINGCOMPLETE);
system\threading\SpinLock.cs (1)
652Interlocked.Exchange(ref m_owner, LOCK_UNOWNED);
system\threading\Tasks\Future.cs (1)
483Interlocked.Exchange(ref m_stateFlags, m_stateFlags | TASK_STATE_RAN_TO_COMPLETION);
system\threading\Tasks\ParallelRangeManager.cs (1)
165Interlocked.Exchange(ref m_indexRanges[m_nCurrentIndexRange].m_bRangeFinished, 1);
system\threading\Tasks\Task.cs (3)
2323Interlocked.Exchange(ref m_stateFlags, m_stateFlags | completionState); 2760int prevState = Interlocked.Exchange(ref m_stateFlags, m_stateFlags | TASK_STATE_CANCELED); 3547Interlocked.Exchange(ref m_stateFlags, m_stateFlags | TASK_STATE_CANCELED);
system\threading\threadpool.cs (2)
309Interlocked.Exchange(ref m_tailIndex, tail); 382Interlocked.Exchange(ref m_headIndex, head + 1);
PresentationFramework (1)
src\Framework\MS\Internal\Data\DataBindEngine.cs (1)
610Interlocked.Exchange(ref _cleanupRequests, 0);
SMSvcHost (3)
System\ServiceModel\Activation\ListenerAdapter.cs (2)
97Interlocked.Exchange(ref closingProcessStatus, ClosingProcessBlocked); 99Interlocked.Exchange(ref closingProcessStatus, ClosingProcessUnBlocked);
System\ServiceModel\Activation\MsmqActivation.cs (1)
610if (Interlocked.Exchange(ref disposed, 1) == 0)
System (52)
net\System\Net\_ConnectStream.cs (3)
2521if (Interlocked.Exchange(ref m_ShutDown, AlreadyAborted) >= AlreadyAborted) { 2544if (Interlocked.Exchange(ref m_CallNesting, nesting) == Nesting.IoInProgress) 2690if (!aborting && Interlocked.Exchange(ref m_ShutDown, AlreadyAborted) >= AlreadyAborted){
net\System\Net\_TimerThread.cs (2)
609return Interlocked.Exchange(ref cancelled, 1) == 0; 789Interlocked.Exchange(ref s_ThreadState, (int) TimerThreadState.Stopped);
net\System\Net\_TLSstream.cs (1)
103if ( Interlocked.Exchange( ref m_ShutDown, 1) == 1 ) {
net\System\Net\Cache\IERequestCache.cs (2)
719if (Interlocked.Exchange(ref m_Disposed, 1) == 0) 943if (Interlocked.Exchange(ref m_Disposed, 1) == 0 && m_Entry != null) {
net\System\Net\HttpListener.cs (2)
2756if (Interlocked.Exchange(ref asyncResult.m_OwnershipState, 2) == 0) 2803int oldValue = Interlocked.Exchange(ref m_OwnershipState, 3);
net\System\Net\HttpWebRequest.cs (1)
6416Interlocked.Exchange(ref isAborted, 1);
net\System\Net\SecureProtocols\_HelperAsyncResults.cs (2)
133int status = Interlocked.Exchange(ref _CompletionStatus, StatusCompleted); 147int status = Interlocked.Exchange(ref _CompletionStatus, StatusCheckedOnSyncCompletion);
net\System\Net\SecureProtocols\_NegoState.cs (2)
384if (Interlocked.Exchange(ref _NestedAuth, 1) == 1) { 429if (Interlocked.Exchange(ref _NestedAuth, 0) == 0)
net\System\Net\SecureProtocols\_NegoStream.cs (2)
126if (Interlocked.Exchange(ref _NestedWrite, 1) == 1) 209if (Interlocked.Exchange(ref _NestedRead, 1) == 1)
net\System\Net\SecureProtocols\_SslState.cs (5)
561if (Interlocked.Exchange(ref _NestedAuth, 1) == 1) { 705if (Interlocked.Exchange(ref _NestedAuth, 0) == 0) 1127int lockState = Interlocked.Exchange(ref _LockReadState, LockHandshake); 1155int lockState = Interlocked.Exchange(ref _LockReadState, newState); 1359int lockState = Interlocked.Exchange(ref _LockWriteState, LockHandshake);
net\System\Net\SecureProtocols\_SslStream.cs (5)
149if (Interlocked.Exchange(ref _NestedRead, 0) == 0) 201if (Interlocked.Exchange(ref _NestedWrite, 0) == 0) 329if (Interlocked.Exchange(ref _NestedWrite, 1) == 1) 383if (Interlocked.Exchange(ref _NestedWrite, 1) == 1) 648if (Interlocked.Exchange(ref _NestedRead, 1) == 1)
net\System\Net\SecureProtocols\NegotiateStream.cs (2)
611if (Interlocked.Exchange(ref _NestedRead, 0) == 0) 680if (Interlocked.Exchange(ref _NestedWrite, 0) == 0)
net\System\Net\Sockets\_BaseOverlappedAsyncResult.cs (1)
595if (m_CleanupCount > 0 && Interlocked.Exchange(ref m_CleanupCount, 0) > 0)
net\System\Net\Sockets\Socket.cs (8)
2742if (Interlocked.Exchange(ref asyncConnectOperationLock, 1) != 0) 2784Interlocked.Exchange(ref asyncConnectOperationLock, 0); 3100if (Interlocked.Exchange(ref asyncConnectOperationLock, 1) != 0) 3114Interlocked.Exchange(ref asyncConnectOperationLock, 0); 3169if (Interlocked.Exchange(ref asyncConnectOperationLock, 1) != 0) 3194Interlocked.Exchange(ref asyncConnectOperationLock, 0); 3338Interlocked.Exchange(ref asyncConnectOperationLock, 0); 7548Interlocked.Exchange(ref m_IntCleanedUp, 0);
net\System\Net\WebSockets\ClientWebSocket.cs (1)
370int priorState = Interlocked.Exchange(ref state, disposed);
net\System\Net\WebSockets\WebSocketBase.cs (1)
1470if ((receiveState = Interlocked.Exchange(ref m_ReceiveState, newReceiveState)) != expectedReceiveState)
net\System\Net\WebSockets\WebSocketBuffer.cs (2)
199int previousState = Interlocked.Exchange(ref m_SendBufferState, SendBufferState.SendPayloadSpecified); 303int previousState = Interlocked.Exchange(ref m_SendBufferState, SendBufferState.None);
net\System\Net\WebSockets\WebSocketHttpListenerDuplexStream.cs (2)
668if (disposing && Interlocked.Exchange(ref m_CleanedUp, 1) == 0) 1184Interlocked.Exchange(ref m_Operating, Free);
parent\parent\parent\InternalApis\NDP_Common\inc\PinnableBufferCache.cs (1)
122int previousNumAllocCalls = Interlocked.Exchange(ref m_numAllocCalls, 0);
regex\system\text\regularexpressions\Regex.cs (4)
1491if (0 == Interlocked.Exchange(ref _locked, 1)) { 1540if (0 == Interlocked.Exchange(ref _locked, 1)) { 1571if (0 == Interlocked.Exchange(ref _locked, 1)) { 1587if (0 == Interlocked.Exchange(ref _locked, 1)) {
sys\system\collections\concurrent\ConcurrentBag.cs (2)
155Interlocked.Exchange(ref list.m_currentOp, (int)ListOperation.Add); 240Interlocked.Exchange(ref list.m_currentOp, (int)ListOperation.Take);
sys\System\IO\compression\DeflaterZLib.cs (1)
219if (Interlocked.Exchange(ref _isValid, 0) != 0) {
System.Core (8)
System\Diagnostics\Eventing\EventProvider.cs (1)
152if (Interlocked.Exchange(ref m_disposed, 1) != 0)
System\Diagnostics\PerformanceData\CounterSetInstance.cs (1)
100if (Interlocked.Exchange(ref m_active, 0) != 0) {
System\Diagnostics\PerformanceData\CounterSetInstanceCounterDataSet.cs (1)
172if (Interlocked.Exchange(ref m_disposed, 1) == 0) {
System\Linq\Parallel\Channels\AsynchronousChannel.cs (4)
308Interlocked.Exchange(ref m_producerBufferIndex, (bufferIndex + 1) % m_buffer.Length); 346Interlocked.Exchange(ref m_producerIsWaiting, 1); 565Interlocked.Exchange(ref m_consumerIsWaiting, 1); 627Interlocked.Exchange(ref m_consumerBufferIndex, (consumerBufferIndex + 1) % m_buffer.Length);
System\Linq\Parallel\Scheduling\QueryTaskGroupState.cs (1)
96if (Interlocked.Exchange(ref m_alreadyEnded, 1) == 0)
System.Data (2)
fx\src\data\System\Data\ProviderBase\DbConnectionPool.cs (1)
1164Interlocked.Exchange(ref _pendingOpensWaiting, 0);
fx\src\data\System\Data\SqlClient\SqlInternalConnectionSmi.cs (1)
237int wasInUse = System.Threading.Interlocked.Exchange(ref _isInUse, 1);
System.Data.Services.Client (4)
System\Data\Services\Client\BaseAsyncResult.cs (3)
227if (System.Threading.Interlocked.Exchange(ref result.done, 1) != 0) 333if (this.IsCompletedInternally && (System.Threading.Interlocked.Exchange(ref this.userNotified, 1) == 0)) 393System.Threading.Interlocked.Exchange(ref this.completed, 2);
System\Data\Services\Client\DataServiceContext.cs (1)
6207System.Threading.Interlocked.Exchange(ref this.requestStatus, 2);
System.Runtime.Caching (7)
System\Caching\MemoryCache.cs (1)
390if (Interlocked.Exchange(ref _disposed, 1) == 0) {
System\Caching\MemoryCacheStatistics.cs (5)
205if (Interlocked.Exchange(ref _inCacheManagerThread, 1) != 0) 249Interlocked.Exchange(ref _inCacheManagerThread, 0); 254if (Interlocked.Exchange(ref _disposed, 1) == 0) { 294while (Interlocked.Exchange(ref _inCacheManagerThread, 1) != 0) { 310Interlocked.Exchange(ref _inCacheManagerThread, 0);
System\Caching\MemoryCacheStore.cs (1)
212if (Interlocked.Exchange(ref _disposed, 1) == 0) {
System.Runtime.Remoting (1)
channels\core\socketmanager.cs (1)
88if (1 == Interlocked.Exchange(ref _controlCookie, 0))
System.ServiceModel (9)
System\ServiceModel\Channels\HttpPipeline.cs (1)
128if (Interlocked.Exchange(ref this.isClosed, 1) == 0)
System\ServiceModel\Diagnostics\PerformanceCountersBase.cs (1)
106if (Interlocked.Exchange(ref disposed, 1) == 0)
System\ServiceModel\Dispatcher\BufferedReceiveBinder.cs (2)
208Interlocked.Exchange(ref binder.pendingOperationSemaphore, 0); 250Interlocked.Exchange(ref binder.pendingOperationSemaphore, 0);
System\ServiceModel\Dispatcher\ChannelHandler.cs (1)
1449Interlocked.Exchange(ref this.isPumpAcquired, 0);
System\ServiceModel\PeerResolvers\PeerDefaultCustomResolverClient.cs (4)
176int oldValue = Interlocked.Exchange(ref this.updateSuccessful, 1); 272Interlocked.Exchange(ref this.updateSuccessful, 1); 283Interlocked.Exchange(ref this.updateSuccessful, 0); 289Interlocked.Exchange(ref this.updateSuccessful, 0);
System.ServiceModel.Activation (4)
System\ServiceModel\Activation\HostedAspNetEnvironment.cs (2)
723if (Interlocked.Exchange(ref this.ambientTransactionCount, 0) != 1) 732if (Interlocked.Exchange(ref this.busyCount, 0) == 1)
System\ServiceModel\Activation\HostedHttpRequestAsyncResult.cs (1)
629int currentStreamedReadState = Interlocked.Exchange(ref this.streamedReadState, StreamedReadState.AbortStarted);
System\ServiceModel\Activation\MetabaseReader.cs (1)
227int handleToClose = Interlocked.Exchange(ref mdHandle, 0);
System.ServiceModel.Internals (1)
System\Runtime\Diagnostics\DiagnosticEventProvider.cs (1)
103if ((this.isDisposed != 1) && (Interlocked.Exchange(ref this.isDisposed, 1) == 0))
System.Transactions (2)
System\Transactions\CommittableTransaction.cs (1)
174if (Interlocked.Exchange(ref this.disposed, Transaction.disposedTrueValue) == Transaction.disposedTrueValue)
System\Transactions\Transaction.cs (1)
1149if (Interlocked.Exchange(ref this.disposed, Transaction.disposedTrueValue) == Transaction.disposedTrueValue)
System.Web (26)
Cache\SqlCacheDependency.cs (1)
985Interlocked.Exchange(ref dbState._rqInCallback, 0);
Compilation\BuildResult.cs (2)
365Interlocked.Exchange(ref _lock, 0); 382Interlocked.Exchange(ref _lock, 0);
Compilation\BuildResultCache.cs (1)
603if (s_shutdownStatus == SHUTDOWN_NEEDED && (Interlocked.Exchange(ref s_shutdownStatus, SHUTDOWN_STARTED) == SHUTDOWN_NEEDED)) {
FileChangesMonitor.cs (5)
474if (Interlocked.Exchange(ref _disposed, 1) == 0) { 1289if (s_notificationQueue.Count > 0 && s_inNotificationThread == 0 && Interlocked.Exchange(ref s_inNotificationThread, 1) == 0) { 1341Interlocked.Exchange(ref s_inNotificationThread, 0); 1345if (s_notificationQueue.Count == 0 || Interlocked.Exchange(ref s_inNotificationThread, 1) != 0) 1350Interlocked.Exchange(ref s_inNotificationThread, 0);
Hosting\HostingEnvironment.cs (2)
207if (Interlocked.Exchange(ref _inTrimCache, 1) != 0) 228Interlocked.Exchange(ref _inTrimCache, 0);
Hosting\IPipelineRuntime.cs (1)
725if (Interlocked.Exchange(ref s_isThisAppDomainRemovedFromUnmanagedTable, 1) != 0) {
Hosting\ISAPIRuntime.cs (1)
233if (Interlocked.Exchange(ref _isThisAppDomainRemovedFromUnmanagedTable, 1) != 0) {
HttpApplication.cs (2)
4391int originalState = Interlocked.Exchange(ref _asyncState, ASYNC_STATE_CALLBACK_COMPLETED); 4405int originalState = Interlocked.Exchange(ref _asyncState, ASYNC_STATE_BEGIN_UNWOUND);
Management\AppDomainResourcePerfCounters.cs (2)
91Interlocked.Exchange(ref _inProgressLock, 1) != 0) // Is some thread currently executing the callback 100Interlocked.Exchange(ref _inProgressLock, 0);
Management\WebEvents.cs (1)
2227Interlocked.Exchange(ref _updatingLastFired, 0);
RequestTimeoutManager.cs (1)
102Interlocked.Exchange(ref _inProgressLock, 0);
State\SessionStateModule.cs (1)
1221Interlocked.Exchange(ref _rqInCallback, 0);
UI\LegacyPageAsyncTask.cs (1)
140if (Interlocked.Exchange(ref _completionMethodLock, 1) != 0) {
Util\CancellationTokenHelper.cs (4)
63Interlocked.Exchange(ref _state, STATE_DISPOSED); 73int originalState = Interlocked.Exchange(ref _state, STATE_DISPOSING); 81Interlocked.Exchange(ref _state, STATE_DISPOSED); 87Interlocked.Exchange(ref _state, STATE_DISPOSED);
WebSockets\AspNetWebSocket.cs (1)
210if (Interlocked.Exchange(ref _abortAsyncCalled, 1) == 0) {
System.Web.Extensions (1)
Handlers\ScriptModule.cs (1)
116if (Interlocked.Exchange(ref _isHandlerRegistered, 1) == 0) {
System.Windows.Forms (1)
winforms\Managed\System\WinForms\Screen.cs (1)
235Interlocked.Exchange(ref currentDesktopChangedCount, Screen.DesktopChangedCount);
WindowsBase (2)
Base\MS\Internal\ShutDownListener.cs (1)
144if (Interlocked.Exchange(ref _inShutDown, 1) == 0)
Base\MS\Internal\WeakEventTable.cs (1)
283Interlocked.Exchange(ref _cleanupRequests, 0);