105 references to Volatile
mscorlib (68)
system\Collections\Concurrent\ConcurrentDictionary.cs (4)
464Volatile.Write<Node>(ref tables.m_buckets[bucketNo], curr.m_next); 511Node n = Volatile.Read<Node>(ref tables.m_buckets[bucketNo]); 792Node current = Volatile.Read<Node>(ref buckets[i]); 902Volatile.Write<Node>(ref tables.m_buckets[bucketNo], new Node(key, value, hashcode, tables.m_buckets[bucketNo]));
system\collections\concurrent\PartitionerStatic.cs (2)
1141long oldSharedIndex = Volatile.Read(ref m_sharedIndex.Value); 1183return Volatile.Read(ref m_sharedIndex.Value) >= SourceCount - 1;
system\Lazy.cs (2)
377object threadSafeObj = Volatile.Read(ref m_threadSafeObj); 390Volatile.Write(ref m_threadSafeObj, ALREADY_INVOKED_SENTINEL);
system\reflection\emit\opcode.cs (2)
265String name = Volatile.Read(ref nameCache[idx]); 271Volatile.Write(ref nameCache[idx], name);
system\rttype.cs (8)
517Volatile.Write(ref m_cacheComplete, true); 1550if (Volatile.Read(ref m_cacheComplete)) 5423ActivatorCacheEntry ace = Volatile.Read(ref cache[index]); 5440Volatile.Write(ref cache[index], ace); 6011Volatile.Write(ref keys[index], key); 6069Volatile.Write(ref m_Table, newTable); 6093Table table = Volatile.Read(ref m_Table); 6107K hit = Volatile.Read(ref keys[index]);
system\runtime\interopservices\gchandlecookietable.cs (7)
63if ((m_FreeIndex < m_HandleList.Length) && (Volatile.Read(ref m_HandleList[m_FreeIndex]) == ObjectHandle.Zero)) 65Volatile.Write(ref m_HandleList[m_FreeIndex], handle); 79Volatile.Write(ref m_HandleList[m_FreeIndex], handle); 112oh = Volatile.Read(ref m_HandleList[GetIndexFromCookie(cookie)]); 137Volatile.Write(ref m_HandleList[index], ObjectHandle.Zero); 162if (Volatile.Read(ref m_HandleList[index]) == ObjectHandle.Zero) 167byte goodData = (byte)(Volatile.Read(ref m_CycleCounts[index]) ^ ADID);
system\runtime\memoryfailpoint.cs (4)
102get { return Volatile.Read(ref hiddenLastKnownFreeAddressSpace); } 103set { Volatile.Write(ref hiddenLastKnownFreeAddressSpace, value); } 113get { return Volatile.Read(ref hiddenLastTimeCheckingAddressSpace); } 114set { Volatile.Write(ref hiddenLastTimeCheckingAddressSpace, value); }
system\runtime\remoting\lifetimeservices.cs (2)
47return TimeSpan.FromTicks(Volatile.Read(ref ticks)); 52Volatile.Write(ref ticks, value.Ticks);
system\runtime\remoting\trackingservices.cs (4)
90Volatile.Write(ref _Handlers[_Size++], handler); 158Volatile.Read(ref temp[i]).MarshaledObject(obj, or); 172Volatile.Read(ref temp[i]).UnmarshaledObject(obj, or); 186Volatile.Read(ref temp[i]).DisconnectedObject(obj);
system\security\permissiontoken.cs (2)
511PermissionToken token = Volatile.Read(ref m_builtIn[index]); 533Volatile.Write(ref m_builtIn[index], token);
system\security\util\tokenbasedset.cs (5)
120e.Current = Volatile.Read(ref m_Set[e.Index]); 261return Volatile.Read(ref m_Set[index]); 295if (index < m_Set.Length && (ret = Volatile.Read(ref m_Set[index])) != null) 299Volatile.Write(ref m_Set[index], null); 308m_Obj = Volatile.Read(ref m_Set[m_maxIndex]);
system\sharedstatics.cs (2)
145Contract.Assert(Volatile.Read(ref _sharedStatics._memFailPointReservedMemory) >= 0, "Process-wide MemoryFailPoint reserved memory was negative!"); 146return (ulong) Volatile.Read(ref _sharedStatics._memFailPointReservedMemory);
system\threading\CancellationTokenSource.cs (3)
680var callbacks = Volatile.Read<SparselyPopulatedArray<CancellationCallbackInfo>>(ref registeredCallbacksLists[myIndex]); 773SparselyPopulatedArray<CancellationCallbackInfo> list = Volatile.Read<SparselyPopulatedArray<CancellationCallbackInfo>>(ref callbackLists[index]); 1200get { return Volatile.Read<T>(ref m_elements[index]); }
system\threading\LazyInitializer.cs (6)
92if (Volatile.Read<T>(ref target) != null) 131if (Volatile.Read<T>(ref target) != null) 175if (Volatile.Read(ref initialized)) 200if (Volatile.Read(ref initialized)) 239if (!Volatile.Read(ref initialized)) 242Volatile.Write(ref initialized, true);
system\threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (1)
166get { return m_completionState != null && Volatile.Read(ref m_completionState.m_completionRequested); }
system\threading\Tasks\ProducerConsumerQueues.cs (1)
202Volatile.Write(ref m_tail.m_next, newSegment); // ensure segment not published until item is fully stored
system\threading\Tasks\Task.cs (1)
2598if (Volatile.Read(ref replicasAreQuitting))
system\threading\threadpool.cs (12)
99Volatile.Write(ref array[i], e); 128Volatile.Write(ref m_array[i], null); 193Volatile.Write(ref m_array[tail & m_mask], obj); 222Volatile.Write(ref m_array[tail & m_mask], obj); 272Volatile.Write(ref m_array[i & m_mask], null); 315obj = Volatile.Read(ref m_array[idx]); 335obj = Volatile.Read(ref m_array[idx]); 387obj = Volatile.Read(ref m_array[idx]); 506Contract.Assert(Volatile.Read(ref nodes[upper]) == null); 507Volatile.Write(ref nodes[upper], node); 537while ((node = Volatile.Read(ref nodes[lower])) == null) 697WorkStealingQueue otherQueue = Volatile.Read(ref otherQueues[i % otherQueues.Length]);
System (12)
compmod\system\componentmodel\TypeDescriptor.cs (2)
2840RefreshEventHandler handler = Volatile.Read(ref Refreshed); 2849RefreshEventHandler handler = Volatile.Read(ref Refreshed);
net\System\Net\_AutoWebProxyScriptEngine.cs (1)
733changeStatus = Volatile.Read(ref s_CurrentVersion);
net\System\Net\_PooledStream.cs (1)
556oldValue = Volatile.Read(ref location1);
net\System\Net\HttpListenerRequest.cs (2)
1024if (Volatile.Read(ref m_TokenBindings) == null) 1028if (Volatile.Read(ref m_TokenBindings) == null)
net\System\Net\WebExceptionStatus.cs (2)
164string message = Volatile.Read(ref s_Mapping[statusInt]); 168Volatile.Write(ref s_Mapping[statusInt], message);
services\monitoring\system\diagnosticts\SharedPerformanceCounter.cs (2)
932long tickDelta = (DateTime.Now.Ticks - Volatile.Read(ref LastInstanceLifetimeSweepTick)); 1026Volatile.Write(ref LastInstanceLifetimeSweepTick, DateTime.Now.Ticks);
sys\system\threading\Barrier.cs (2)
201get { return Volatile.Read(ref m_currentPhase); } 203internal set { Volatile.Write(ref m_currentPhase, value); }
System.Core (5)
Microsoft\Scripting\Utils\CacheDict.cs (3)
81var entry = Volatile.Read(ref this.entries[idx]); 100var entry = Volatile.Read(ref this.entries[idx]); 103Volatile.Write(ref entries[idx], new Entry(hash, key, value));
System\Linq\Parallel\QueryOperators\Unary\SingleQueryOperator.cs (1)
180if (Volatile.Read(ref m_totalElementCount.Value) > 1)
system\threading\ReaderWriterLockSlim\ReaderWriterLockSlim.cs (1)
1705Volatile.Write(ref _isLocked, 0);
System.Data (3)
fx\src\data\System\Data\SqlClient\TdsParserStateObject.cs (3)
854Debug.Assert(Volatile.Read(ref _readingCount) >= 0, "_readingCount is negative"); 855if (Volatile.Read(ref _readingCount) > 0) { 863SpinWait.SpinUntil(() => Volatile.Read(ref _readingCount) == 0);
System.Web (15)
AspNetSynchronizationContext.cs (1)
151if (!AllowAsyncDuringSyncStages && Volatile.Read(ref _state.VoidAsyncOutstandingOperationCount) > 0) {
Hosting\AsyncResultBase.cs (1)
38if (Volatile.Read(ref _threadWhichStartedOperation) == Thread.CurrentThread) {
Hosting\HostingEnvironment.cs (1)
1189BackgroundWorkScheduler scheduler = Volatile.Read(ref _backgroundWorkScheduler);
HttpAsyncResult.cs (1)
69if (Volatile.Read(ref _threadWhichStartedOperation) == Thread.CurrentThread) {
HttpContext.cs (11)
1690get { return Volatile.Read(ref _threadAbortOnTimeout); } 1691set { Volatile.Write(ref _threadAbortOnTimeout, value); } 1702long ticks = Volatile.Read(ref _timeoutTicks); 1750if (Volatile.Read(ref _timeoutStartTimeUtcTicks) == -1) { 1754Volatile.Write(ref _timeoutState, 1); 1766while (Volatile.Read(ref _timeoutState) == -1) 1771get { return (Volatile.Read(ref _timeoutState) == 1); } 1784if (Volatile.Read(ref _timeoutState) == 1 && ThreadAbortOnTimeout) { // fast check 1785long expirationUtcTicks = Volatile.Read(ref _timeoutStartTimeUtcTicks) + Timeout.Ticks; // don't care about overflow 1814if (Volatile.Read(ref _timeoutState) != 1 || !ThreadAbortOnTimeout) { 1819long expirationUtcTicks = Volatile.Read(ref _timeoutStartTimeUtcTicks) + Timeout.Ticks; // don't care about overflow
System.Web.Extensions (2)
UI\BundleReflectionHelper.cs (2)
115if (!Volatile.Read(ref s_lookedForCurrentProperty)) { 128Volatile.Write(ref s_lookedForCurrentProperty, true);