140 references to Read
GenerateDocumentationAndConfigFiles (2)
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (1)
68var existingValue = Volatile.Read(ref target);
src\Compilers\Core\Portable\InternalUtilities\SingleInitNullable.cs (1)
52=> Volatile.Read(ref _initialized) == 2 ? _value : null;
Interop.FunctionalTests (1)
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
76if (Volatile.Read(ref _pinCount) > 0)
Metrics (2)
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (1)
68var existingValue = Volatile.Read(ref target);
src\Compilers\Core\Portable\InternalUtilities\SingleInitNullable.cs (1)
52=> Volatile.Read(ref _initialized) == 2 ? _value : null;
Metrics.Legacy (2)
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (1)
68var existingValue = Volatile.Read(ref target);
src\Compilers\Core\Portable\InternalUtilities\SingleInitNullable.cs (1)
52=> Volatile.Read(ref _initialized) == 2 ? _value : null;
Microsoft.AspNetCore.ConcurrencyLimiter (1)
ConcurrencyLimiterEventSource.cs (1)
96_queueLengthCounter ??= new PollingCounter("queue-length", this, () => Volatile.Read(ref _queueLength))
Microsoft.AspNetCore.Server.HttpSys (1)
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
76if (Volatile.Read(ref _pinCount) > 0)
Microsoft.AspNetCore.Server.IIS (1)
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
76if (Volatile.Read(ref _pinCount) > 0)
Microsoft.AspNetCore.Server.Kestrel.Core (1)
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
76if (Volatile.Read(ref _pinCount) > 0)
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (1)
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
76if (Volatile.Read(ref _pinCount) > 0)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (1)
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
76if (Volatile.Read(ref _pinCount) > 0)
Microsoft.CodeAnalysis (5)
CodeGen\TokenMap.cs (1)
111int count = Volatile.Read(ref _count);
Compilation\Compilation.cs (2)
1842if (Volatile.Read(ref _eventQueueEnqueuePendingCount) != 0) 1844SpinWait.SpinUntil(() => Volatile.Read(ref _eventQueueEnqueuePendingCount) == 0);
InternalUtilities\InterlockedOperations.cs (1)
68var existingValue = Volatile.Read(ref target);
InternalUtilities\SingleInitNullable.cs (1)
52=> Volatile.Read(ref _initialized) == 2 ? _value : null;
Microsoft.CodeAnalysis.Analyzers (2)
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (1)
68var existingValue = Volatile.Read(ref target);
src\Compilers\Core\Portable\InternalUtilities\SingleInitNullable.cs (1)
52=> Volatile.Read(ref _initialized) == 2 ? _value : null;
Microsoft.CodeAnalysis.AnalyzerUtilities (2)
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (1)
68var existingValue = Volatile.Read(ref target);
src\Compilers\Core\Portable\InternalUtilities\SingleInitNullable.cs (1)
52=> Volatile.Read(ref _initialized) == 2 ? _value : null;
Microsoft.CodeAnalysis.BannedApiAnalyzers (2)
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (1)
68var existingValue = Volatile.Read(ref target);
src\Compilers\Core\Portable\InternalUtilities\SingleInitNullable.cs (1)
52=> Volatile.Read(ref _initialized) == 2 ? _value : null;
Microsoft.CodeAnalysis.CodeStyle (2)
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (1)
68var existingValue = Volatile.Read(ref target);
src\Compilers\Core\Portable\InternalUtilities\SingleInitNullable.cs (1)
52=> Volatile.Read(ref _initialized) == 2 ? _value : null;
Microsoft.CodeAnalysis.CSharp (14)
Symbols\LexicalSortKey.cs (1)
131return Volatile.Read(ref _position) >= 0;
Symbols\Metadata\PE\PEMethodSymbol.cs (8)
134public bool IsObsoleteAttributePopulated => (Volatile.Read(ref _bits) & IsObsoleteAttributePopulatedBit) != 0; 135public bool IsCustomAttributesPopulated => (Volatile.Read(ref _bits) & IsCustomAttributesPopulatedBit) != 0; 136public bool IsUseSiteDiagnosticPopulated => (Volatile.Read(ref _bits) & IsUseSiteDiagnosticPopulatedBit) != 0; 137public bool IsConditionalPopulated => (Volatile.Read(ref _bits) & IsConditionalPopulatedBit) != 0; 138public bool IsOverriddenOrHiddenMembersPopulated => (Volatile.Read(ref _bits) & IsOverriddenOrHiddenMembersPopulatedBit) != 0; 143public bool IsMemberNotNullPopulated => (Volatile.Read(ref _bits) & IsMemberNotNullPopulatedBit) != 0; 146public bool IsUnmanagedCallersOnlyAttributePopulated => (Volatile.Read(ref _bits) & IsUnmanagedCallersOnlyAttributePopulatedBit) != 0; 151public bool IsOverloadResolutionPriorityPopulated => (Volatile.Read(ref _bits) & OverloadResolutionPriorityPopulatedBit) != 0;
Symbols\Metadata\PE\PEPropertySymbol.cs (4)
131public bool IsUseSiteDiagnosticPopulated => (Volatile.Read(ref _bits) & IsUseSiteDiagnosticPopulatedBit) != 0; 138public bool IsObsoleteAttributePopulated => (Volatile.Read(ref _bits) & IsObsoleteAttributePopulatedBit) != 0; 145public bool IsCustomAttributesPopulated => (Volatile.Read(ref _bits) & IsCustomAttributesPopulatedBit) != 0; 152public bool IsOverloadResolutionPriorityPopulated => (Volatile.Read(ref _bits) & IsOverloadResolutionPriorityPopulatedBit) != 0;
Symbols\Source\SourceMemberFieldSymbol.cs (1)
631return _lazyFieldTypeInferred != 0 || Volatile.Read(ref _lazyFieldTypeInferred) != 0;
Microsoft.CodeAnalysis.EditorFeatures (1)
InlineHints\InlineHintsKeyProcessorProvider.cs (1)
47return Volatile.Read(ref _state) == 1;
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (2)
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (1)
68var existingValue = Volatile.Read(ref target);
src\Compilers\Core\Portable\InternalUtilities\SingleInitNullable.cs (1)
52=> Volatile.Read(ref _initialized) == 2 ? _value : null;
Microsoft.CodeAnalysis.PublicApiAnalyzers (2)
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (1)
68var existingValue = Volatile.Read(ref target);
src\Compilers\Core\Portable\InternalUtilities\SingleInitNullable.cs (1)
52=> Volatile.Read(ref _initialized) == 2 ? _value : null;
Microsoft.CodeAnalysis.ResxSourceGenerator (2)
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (1)
68var existingValue = Volatile.Read(ref target);
src\Compilers\Core\Portable\InternalUtilities\SingleInitNullable.cs (1)
52=> Volatile.Read(ref _initialized) == 2 ? _value : null;
Microsoft.CodeAnalysis.VisualBasic (6)
Symbols\LexicalSortKey.vb (1)
229Return Volatile.Read(Me._position) >= 0
Symbols\Metadata\PE\PEMethodSymbol.vb (5)
118Return (Volatile.Read(_bits) And s_isObsoleteAttributePopulatedBit) <> 0 124Return (Volatile.Read(_bits) And s_isCustomAttributesPopulatedBit) <> 0 130Return (Volatile.Read(_bits) And s_isUseSiteDiagnosticPopulatedBit) <> 0 136Return (Volatile.Read(_bits) And s_isConditionalAttributePopulatedBit) <> 0 205Return (Volatile.Read(_bits) And s_OverloadResolutionPriorityIsPopulatedBit) <> 0
Microsoft.CodeAnalysis.Workspaces (4)
Shared\Utilities\StreamingProgressTracker.cs (2)
32=> updateAction?.Invoke(Volatile.Read(ref _completedItems), Volatile.Read(ref _totalItems), cancellationToken) ?? default;
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (1)
68var existingValue = Volatile.Read(ref target);
src\Compilers\Core\Portable\InternalUtilities\SingleInitNullable.cs (1)
52=> Volatile.Read(ref _initialized) == 2 ? _value : null;
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (2)
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (1)
68var existingValue = Volatile.Read(ref target);
src\Compilers\Core\Portable\InternalUtilities\SingleInitNullable.cs (1)
52=> Volatile.Read(ref _initialized) == 2 ? _value : null;
Microsoft.Extensions.AsyncState (1)
AsyncState.cs (1)
108internal int ContextCount => Volatile.Read(ref _contextCount);
Microsoft.Extensions.Caching.Hybrid (3)
Internal\DefaultHybridCache.CacheItem.cs (2)
41internal int RefCount => Volatile.Read(ref _refCount); 81int oldValue = Volatile.Read(ref _refCount);
Internal\DefaultHybridCache.Debug.cs (1)
35=> flush ? Interlocked.Exchange(ref _outstandingBufferCount, 0) : Volatile.Read(ref _outstandingBufferCount);
Microsoft.Extensions.Caching.Hybrid.Tests (25)
L2Tests.cs (1)
214public int OpCount => Volatile.Read(ref ProtectedOpCount);
SizeTests.cs (6)
195Assert.Equal(runCount, Volatile.Read(ref actualRunCount)); 261Assert.Equal(runCount, Volatile.Read(ref actualRunCount)); 285public int ReadCount => Volatile.Read(ref _readCount); 286public int WriteCount => Volatile.Read(ref _writeCount); 328public int ReadCount => Volatile.Read(ref _readCount); 329public int WriteCount => Volatile.Read(ref _writeCount);
StampedeTests.cs (18)
117Assert.Equal(0, Volatile.Read(ref executeCount)); 118Assert.Equal(0, Volatile.Read(ref cancelCount)); 121Assert.Equal(1, Volatile.Read(ref executeCount)); 122Assert.Equal(0, Volatile.Read(ref cancelCount)); 128Assert.Equal(1, Volatile.Read(ref executeCount)); 129Assert.Equal(0, Volatile.Read(ref cancelCount)); 153Assert.Equal(0, Volatile.Read(ref executeCount)); 154Assert.Equal(0, Volatile.Read(ref cancelCount)); 158Assert.Equal(1, Volatile.Read(ref executeCount)); 159Assert.Equal(0, Volatile.Read(ref cancelCount)); 165Assert.Equal(1, Volatile.Read(ref executeCount)); 166Assert.Equal(0, Volatile.Read(ref cancelCount)); 229Assert.Equal(0, Volatile.Read(ref executeCount)); 238Assert.Equal(1, Volatile.Read(ref executeCount)); 239Assert.Equal(1, Volatile.Read(ref cancelCount)); 313Assert.Equal(0, Volatile.Read(ref executeCount)); 322Assert.Equal(1, Volatile.Read(ref executeCount)); 323Assert.Equal(0, Volatile.Read(ref cancelCount)); // ran to completion
Microsoft.Extensions.Diagnostics.ResourceMonitoring (2)
Linux\LinuxUtilizationProvider.cs (1)
281if (Volatile.Read(ref _measurementsUnavailable) == 1 &&
Linux\Network\LinuxNetworkMetrics.cs (1)
93if (Volatile.Read(ref unavailableFlag) == 0 || _timeProvider.GetUtcNow() - lastFailureTime > _retryInterval)
Roslyn.Diagnostics.Analyzers (2)
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (1)
68var existingValue = Volatile.Read(ref target);
src\Compilers\Core\Portable\InternalUtilities\SingleInitNullable.cs (1)
52=> Volatile.Read(ref _initialized) == 2 ? _value : null;
System.ComponentModel.TypeConverter (1)
System\ComponentModel\InterlockedBitVector32.cs (1)
20get => (Volatile.Read(ref _data) & bit) == bit;
System.Diagnostics.DiagnosticSource (1)
System\Diagnostics\RateLimiter.cs (1)
46int currentOperationCount = Volatile.Read(ref _currentOperationCount);
System.Linq.Parallel (1)
System\Linq\Parallel\QueryOperators\Unary\SingleQueryOperator.cs (1)
176if (Volatile.Read(ref _totalElementCount.Value) > 1)
System.Net.WebClient (1)
System\Net\WebClient.cs (1)
216public bool IsBusy => Volatile.Read(ref _callNesting) > 0;
System.Private.CoreLib (38)
src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentQueue.cs (21)
266int headHead = Volatile.Read(ref head._headAndTail.Head); 267int headTail = Volatile.Read(ref head._headAndTail.Tail); 278headHead == Volatile.Read(ref head._headAndTail.Head) && 279headTail == Volatile.Read(ref head._headAndTail.Tail)) 288int tailHead = Volatile.Read(ref tail._headAndTail.Head); 289int tailTail = Volatile.Read(ref tail._headAndTail.Tail); 292headHead == Volatile.Read(ref head._headAndTail.Head) && 293headTail == Volatile.Read(ref head._headAndTail.Tail) && 294tailHead == Volatile.Read(ref tail._headAndTail.Head) && 295tailTail == Volatile.Read(ref tail._headAndTail.Tail)) 314int tailHead = Volatile.Read(ref tail._headAndTail.Head); 315int tailTail = Volatile.Read(ref tail._headAndTail.Tail); 316if (headHead == Volatile.Read(ref head._headAndTail.Head) && 317headTail == Volatile.Read(ref head._headAndTail.Tail) && 318tailHead == Volatile.Read(ref tail._headAndTail.Head) && 319tailTail == Volatile.Read(ref tail._headAndTail.Tail)) 379int headTail = (head == tail ? tailTail : Volatile.Read(ref head._headAndTail.Tail)) - head.FreezeOffset; 516headHead = Volatile.Read(ref head._headAndTail.Head); 517tailTail = Volatile.Read(ref tail._headAndTail.Tail); 533while ((Volatile.Read(ref segment._slots[i].SequenceNumber) & segment._slotsMask) != expectedSequenceNumberAndMask) 553int headTail = (head == tail ? tailTail : Volatile.Read(ref head._headAndTail.Tail)) - head.FreezeOffset;
src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentQueueSegment.cs (8)
116int currentHead = Volatile.Read(ref _headAndTail.Head); 120int sequenceNumber = Volatile.Read(ref slots[slotsIndex].SequenceNumber); 167int currentTail = Volatile.Read(ref _headAndTail.Tail); 212int currentHead = Volatile.Read(ref _headAndTail.Head); 216int sequenceNumber = Volatile.Read(ref slots[slotsIndex].SequenceNumber); 236int currentTail = Volatile.Read(ref _headAndTail.Tail); 274int currentTail = Volatile.Read(ref _headAndTail.Tail); 278int sequenceNumber = Volatile.Read(ref slots[slotsIndex].SequenceNumber);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventCounter.cs (1)
63int count = Volatile.Read(ref _count);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\ConditionalWeakTable.cs (1)
659for (int entriesIndex = Volatile.Read(ref _buckets[bucket]); entriesIndex != -1; entriesIndex = _entries[entriesIndex].Next)
src\libraries\System.Private.CoreLib\src\System\Security\SecureString.cs (1)
71return Volatile.Read(ref _decryptedLength);
src\libraries\System.Private.CoreLib\src\System\Threading\DeferredDisposableLifetime.cs (3)
50int oldCount = Volatile.Read(ref _count); 67int oldCount = Volatile.Read(ref _count); 99int oldCount = Volatile.Read(ref _count);
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.cs (1)
436int priorTime = Volatile.Read(ref _separated.priorCompletedWorkRequestsTime);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (1)
1194if (Volatile.Read(ref m_taskId) == 0)
src\libraries\System.Private.CoreLib\src\System\Threading\Thread.cs (1)
583public static int VolatileRead(ref int address) => Volatile.Read(ref address);
System.Reflection.MetadataLoadContext (1)
System\Reflection\TypeLoading\Modules\GetTypeCoreCache.cs (1)
84int i = Volatile.Read(ref _buckets[bucket]);
System.Threading.Tasks.Parallel (1)
System\Threading\Tasks\ParallelLoopState.cs (1)
362return Unsafe.BitCast<int, TInt>(Volatile.Read(ref Unsafe.As<TInt, int>(ref _lowestBreakIteration)));
Test.Utilities (2)
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (1)
68var existingValue = Volatile.Read(ref target);
src\Compilers\Core\Portable\InternalUtilities\SingleInitNullable.cs (1)
52=> Volatile.Read(ref _initialized) == 2 ? _value : null;
Text.Analyzers (2)
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (1)
68var existingValue = Volatile.Read(ref target);
src\Compilers\Core\Portable\InternalUtilities\SingleInitNullable.cs (1)
52=> Volatile.Read(ref _initialized) == 2 ? _value : null;