143 references to Read
dotnet (2)
Commands\Test\MTP\CtrlCCancellationManager.cs (1)
70if (Volatile.Read(ref _state) == StateForcing)
Commands\Test\MTP\TestApplication.cs (1)
489Volatile.Read(ref _protocolNegotiated) == 0 ? null : IsProtocol_1_1_OrHigher;
GenerateDocumentationAndConfigFiles (2)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (1)
68var existingValue = Volatile.Read(ref target);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\SingleInitNullable.cs (1)
52=> Volatile.Read(ref _initialized) == 2 ? _value : null;
Microsoft.AspNetCore.Razor.Utilities.Shared (4)
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\InterlockedOperations.cs (4)
111if (Volatile.Read(ref state) == Initialized) 142while (Volatile.Read(ref state) != Initialized) 194if (Volatile.Read(ref state) == Initialized) 225while (Volatile.Read(ref state) != Initialized)
Microsoft.AspNetCore.Server.HttpSys (1)
src\aspnetcore\src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
76if (Volatile.Read(ref _pinCount) > 0)
Microsoft.AspNetCore.Server.IIS (1)
src\aspnetcore\src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
76if (Volatile.Read(ref _pinCount) > 0)
Microsoft.AspNetCore.Server.Kestrel.Core (1)
src\aspnetcore\src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
76if (Volatile.Read(ref _pinCount) > 0)
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (1)
src\aspnetcore\src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
76if (Volatile.Read(ref _pinCount) > 0)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (1)
src\aspnetcore\src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
76if (Volatile.Read(ref _pinCount) > 0)
Microsoft.Build (1)
BackEnd\Components\RequestBuilder\RequestBuilder.cs (1)
1578var count = Volatile.Read(ref _availableThreads);
Microsoft.Build.Framework (1)
Utilities\TypeInfo.cs (1)
27int value = Volatile.Read(ref s_hasReferences);
Microsoft.CodeAnalysis (5)
CodeGen\TokenMap.cs (1)
111int count = Volatile.Read(ref _count);
Compilation\Compilation.cs (2)
1862if (Volatile.Read(ref _eventQueueEnqueuePendingCount) != 0) 1864SpinWait.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\roslyn\src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (1)
68var existingValue = Volatile.Read(ref target);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\SingleInitNullable.cs (1)
52=> Volatile.Read(ref _initialized) == 2 ? _value : null;
Microsoft.CodeAnalysis.AnalyzerUtilities (2)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (1)
68var existingValue = Volatile.Read(ref target);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\SingleInitNullable.cs (1)
52=> Volatile.Read(ref _initialized) == 2 ? _value : null;
Microsoft.CodeAnalysis.CodeStyle (2)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (1)
68var existingValue = Volatile.Read(ref target);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\SingleInitNullable.cs (1)
52=> Volatile.Read(ref _initialized) == 2 ? _value : null;
Microsoft.CodeAnalysis.CSharp (6)
Symbols\LexicalSortKey.cs (1)
131return Volatile.Read(ref _position) >= 0;
Symbols\Metadata\PE\PEPropertySymbol.cs (4)
154public bool IsUseSiteDiagnosticPopulated => (Volatile.Read(ref _bits) & IsUseSiteDiagnosticPopulatedBit) != 0; 161public bool IsObsoleteAttributePopulated => (Volatile.Read(ref _bits) & IsObsoleteAttributePopulatedBit) != 0; 168public bool IsCustomAttributesPopulated => (Volatile.Read(ref _bits) & IsCustomAttributesPopulatedBit) != 0; 175public bool IsOverloadResolutionPriorityPopulated => (Volatile.Read(ref _bits) & IsOverloadResolutionPriorityPopulatedBit) != 0;
Symbols\Source\SourceMemberFieldSymbol.cs (1)
661return _lazyFieldTypeInferred != 0 || Volatile.Read(ref _lazyFieldTypeInferred) != 0;
Microsoft.CodeAnalysis.Razor.Compiler (1)
Language\Intermediate\LazyContent.cs (1)
42return Volatile.Read(ref _state) == Initialized
Microsoft.CodeAnalysis.ResxSourceGenerator (2)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (1)
68var existingValue = Volatile.Read(ref target);
src\roslyn\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\roslyn\src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (1)
68var existingValue = Volatile.Read(ref target);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\SingleInitNullable.cs (1)
52=> Volatile.Read(ref _initialized) == 2 ? _value : null;
Microsoft.DotNet.Cli.Utils (1)
TypeInfo.cs (1)
30int value = Volatile.Read(ref s_hasReferences);
Microsoft.Extensions.AsyncState (1)
AsyncState.cs (1)
104internal 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)
215public 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)
319if (Volatile.Read(ref _measurementsUnavailable) == 1 &&
Linux\Network\LinuxNetworkMetrics.cs (1)
93if (Volatile.Read(ref unavailableFlag) == 0 || _timeProvider.GetUtcNow() - lastFailureTime > _retryInterval)
Microsoft.Extensions.Diagnostics.Testing (1)
Logging\FakeLogCollector.LogEnumeration.cs (1)
205if (Volatile.Read(ref _disposed) == 1)
Microsoft.Extensions.FileProviders.Physical (2)
PhysicalFilesWatcher.cs (2)
614Volatile.Read(ref _subdirectoryRequiringTokenCount) == 0) 661Volatile.Read(ref _subdirectoryRequiringTokenCount) > 0;
Microsoft.Extensions.ML (5)
PoolLoader.cs (3)
63if (Volatile.Read(ref _disposed) != 0 || pool == null) 99if (Volatile.Read(ref _disposed) != 0) 113if (Volatile.Read(ref _disposed) != 0 && Interlocked.CompareExchange(ref _pool, null, newPool) == newPool)
PredictionEnginePool.cs (2)
90if (Volatile.Read(ref _disposed) != 0) 151if (Volatile.Read(ref _disposed) != 0)
Microsoft.Interop.JavaScript.JSImportGenerator (1)
Analyzers\JSImportExportDiagnosticsAnalyzer.cs (1)
103if (Volatile.Read(ref foundMethod) != 0)
Microsoft.Interop.LibraryImportGenerator (1)
Analyzers\LibraryImportDiagnosticsAnalyzer.cs (1)
81if (Volatile.Read(ref foundLibraryImportMethod) != 0 && !unsafeEnabled)
Microsoft.Interop.LibraryImportGenerator.Downlevel (1)
DownlevelLibraryImportDiagnosticsAnalyzer.cs (1)
75if (Volatile.Read(ref foundLibraryImportMethod) != 0)
MSBuild.Coordinator (1)
CoordinatorServer.cs (1)
36private bool HasActiveConnections => Volatile.Read(ref _activeConnections) > 0;
Roslyn.Diagnostics.Analyzers (2)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (1)
68var existingValue = Volatile.Read(ref target);
src\roslyn\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.Console (1)
System\ConsolePal.Unix.cs (1)
989int cursorVersion = mayChangeCursorPosition ? Volatile.Read(ref s_cursorVersion) : -1;
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.Http (1)
System\Net\Http\SocketsHttpHandler\CreditManager.cs (1)
31public bool IsCreditAvailable => Volatile.Read(ref _current) > 0;
System.Net.Sockets (2)
System\Net\Sockets\SocketAsyncContext.Unix.cs (2)
820QueueState state = (QueueState)Volatile.Read(ref Unsafe.As<QueueState, int>(ref _state)); 821observedSequenceNumber = Volatile.Read(ref _sequenceNumber);
System.Net.WebClient (1)
System\Net\WebClient.cs (1)
216public bool IsBusy => Volatile.Read(ref _callNesting) > 0;
System.Private.CoreLib (42)
src\runtime\src\coreclr\nativeaot\Common\src\System\Collections\Concurrent\ConcurrentUnifier.cs (1)
157int i = Volatile.Read(ref _buckets[bucket]);
src\runtime\src\coreclr\nativeaot\Common\src\System\Collections\Concurrent\ConcurrentUnifierW.cs (1)
184int i = Volatile.Read(ref _buckets[bucket]);
src\runtime\src\coreclr\nativeaot\Common\src\System\Collections\Concurrent\ConcurrentUnifierWKeyed.cs (1)
193int i = Volatile.Read(ref _buckets[bucket]);
src\runtime\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\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventCounter.cs (1)
63int count = Volatile.Read(ref _count);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\ConditionalWeakTable.cs (1)
660for (int entriesIndex = Volatile.Read(ref _buckets[bucket]); entriesIndex != -1; entriesIndex = _entries[entriesIndex].Next)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Security\SecureString.cs (1)
72return Volatile.Read(ref _decryptedLength);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Lock.cs (2)
780StaticsInitializationStage stage = (StaticsInitializationStage)Volatile.Read(ref s_staticsInitializationStage); 805stage = (StaticsInitializationStage)Volatile.Read(ref s_staticsInitializationStage);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ManualResetEventSlim.cs (1)
104return Volatile.Read(ref m_combinedState) < 0;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.cs (1)
454int priorTime = Volatile.Read(ref _separated.priorCompletedWorkRequestsTime);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (1)
1342if (Volatile.Read(ref m_taskId) == 0)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Thread.cs (1)
576public static int VolatileRead(ref int address) => Volatile.Read(ref address);
System\Threading\Thread.NativeAot.cs (1)
498if (Volatile.Read(ref s_foregroundRunningCount) == 0)
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)));