42 references to MemoryBarrier
System.Collections.Concurrent (1)
System\Collections\Concurrent\ConcurrentBag.cs (1)
626Interlocked.MemoryBarrier(); // prevent reads of _currentOp from moving before writes to _frozen
System.Private.CoreLib (9)
src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentQueueSegment.cs (1)
202Interlocked.MemoryBarrier();
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureInfo.cs (1)
858Interlocked.MemoryBarrier();
src\libraries\System.Private.CoreLib\src\System\Threading\Interlocked.cs (3)
586/// the call to <see cref="MemoryBarrier"/> execute after memory accesses that follow the call to <see cref="MemoryBarrier"/>. 589public static void MemoryBarrier() => MemoryBarrier();
src\libraries\System.Private.CoreLib\src\System\Threading\Thread.cs (1)
543public static void MemoryBarrier() => Interlocked.MemoryBarrier();
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolWorkQueue.cs (3)
591Interlocked.MemoryBarrier(); 1107Interlocked.MemoryBarrier(); 1168Interlocked.MemoryBarrier(); // ensure that an old cached value is not read below
System.Private.DataContractSerialization (19)
System\Runtime\Serialization\ClassDataContract.cs (6)
93Interlocked.MemoryBarrier(); 206Interlocked.MemoryBarrier(); 240Interlocked.MemoryBarrier(); 955Interlocked.MemoryBarrier(); 1094Interlocked.MemoryBarrier(); 1219Interlocked.MemoryBarrier();
System\Runtime\Serialization\CollectionDataContract.cs (5)
223Interlocked.MemoryBarrier(); 290Interlocked.MemoryBarrier(); 324Interlocked.MemoryBarrier(); 369Interlocked.MemoryBarrier(); 705Interlocked.MemoryBarrier();
System\Runtime\Serialization\EnumDataContract.cs (1)
277Interlocked.MemoryBarrier();
System\Runtime\Serialization\Json\JsonClassDataContract.cs (2)
48Interlocked.MemoryBarrier(); 79Interlocked.MemoryBarrier();
System\Runtime\Serialization\Json\JsonCollectionDataContract.cs (3)
48Interlocked.MemoryBarrier(); 85Interlocked.MemoryBarrier(); 116Interlocked.MemoryBarrier();
System\Runtime\Serialization\XmlDataContract.cs (2)
107Interlocked.MemoryBarrier(); 195Interlocked.MemoryBarrier();
System.Text.Json (4)
System\Text\Json\Nodes\JsonArray.cs (2)
322Interlocked.MemoryBarrier(); 339Interlocked.MemoryBarrier();
System\Text\Json\Nodes\JsonObject.IDictionary.cs (2)
220Interlocked.MemoryBarrier(); 240Interlocked.MemoryBarrier();
System.Threading.Tasks.Dataflow (5)
Internal\SourceCore.cs (3)
395Interlocked.MemoryBarrier(); // ensure the read of _taskForOutputProcessing doesn't move up before the writes in Enqueue 450Interlocked.MemoryBarrier(); // ensure the read of _taskForOutputProcessing doesn't move up before the writes in Enqueue 861Interlocked.MemoryBarrier(); // synchronize with AddMessage(s) and its read of _taskForOutputProcessing
Internal\SpscTargetCore.cs (2)
94Interlocked.MemoryBarrier(); // ensure the read of _activeConsumer doesn't move up before the writes in Enqueue 150Interlocked.MemoryBarrier(); // ensure the read of _activeConsumer doesn't move up before the writes in Enqueue
System.Transactions.Local (4)
System\Transactions\Enlistment.cs (1)
215Interlocked.MemoryBarrier();
System\Transactions\Transaction.cs (1)
778Interlocked.MemoryBarrier();
System\Transactions\TransactionTable.cs (2)
625Interlocked.MemoryBarrier(); // This data must be written before the transaction 667Interlocked.MemoryBarrier();