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