From f0fde59220c29f63d412f9e4dd38be158a29533b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 5 Aug 2025 21:28:01 +0000 Subject: [PATCH 1/2] Initial plan From 7e0cc5a081672bcd4ab7c0a3e072f551f2582016 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 5 Aug 2025 21:34:08 +0000 Subject: [PATCH 2/2] Add documentation warning for Interlocked.Read write access requirement on 32-bit platforms Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com> --- xml/System.Threading/Interlocked.xml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/xml/System.Threading/Interlocked.xml b/xml/System.Threading/Interlocked.xml index 9c97cae3482..564e4065953 100644 --- a/xml/System.Threading/Interlocked.xml +++ b/xml/System.Threading/Interlocked.xml @@ -2950,6 +2950,9 @@ This method wraps a call to [FlushProcessWriteBuffers](/windows/win32/api/proces ## Remarks The method is unnecessary on 64-bit systems, because 64-bit read operations are already atomic. On 32-bit systems, 64-bit read operations are not atomic unless performed using . +> [!IMPORTANT] +> On 32-bit platforms, despite taking a readonly reference parameter, this method requires write access to the memory location because it uses internally to ensure atomicity. Attempting to read from read-only memory (such as memory-mapped files opened with read-only access) can result in an . + ]]> @@ -3006,7 +3009,17 @@ This method wraps a call to [FlushProcessWriteBuffers](/windows/win32/api/proces The 64-bit value to be loaded. Returns a 64-bit unsigned value, loaded as an atomic operation. The loaded value. - To be added. + + method is unnecessary on 64-bit systems, because 64-bit read operations are already atomic. On 32-bit systems, 64-bit read operations are not atomic unless performed using . + +> [!IMPORTANT] +> On 32-bit platforms, despite taking a readonly reference parameter, this method requires write access to the memory location because it uses internally to ensure atomicity. Attempting to read from read-only memory (such as memory-mapped files opened with read-only access) can result in an . + + ]]> +