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