Skip to content

Use nint for native-sized integers in Interlocked #11643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions xml/System.Threading/Interlocked.xml
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@
</Docs>
</Member>
<Member MemberName="CompareExchange">
<MemberSignature Language="C#" Value="public static IntPtr CompareExchange (ref IntPtr location1, IntPtr value, IntPtr comparand);" />
<MemberSignature Language="C#" Value="public static nint CompareExchange (ref nint location1, nint value, nint comparand);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig native int CompareExchange(native int&amp; location1, native int value, native int comparand) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Threading.Interlocked.CompareExchange(System.IntPtr@,System.IntPtr,System.IntPtr)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function CompareExchange (ByRef location1 As IntPtr, value As IntPtr, comparand As IntPtr) As IntPtr" />
Expand Down Expand Up @@ -858,10 +858,10 @@
<Parameter Name="comparand" Type="System.IntPtr" Index="2" FrameworkAlternate="dotnet-uwp-10.0;net-10.0;net-5.0;net-6.0;net-7.0;net-8.0;net-9.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6;netstandard-2.0;netstandard-2.1" />
</Parameters>
<Docs>
<param name="location1">The destination <see cref="T:System.IntPtr" />, whose value is compared with the value of <paramref name="comparand" /> and possibly replaced by <paramref name="value" />.</param>
<param name="value">The <see cref="T:System.IntPtr" /> that replaces the destination value if the comparison results in equality.</param>
<param name="comparand">The <see cref="T:System.IntPtr" /> that is compared to the value at <paramref name="location1" />.</param>
<summary>Compares two platform-specific handles or pointers for equality and, if they are equal, replaces the first one, as an atomic operation.</summary>
<param name="location1">The destination, whose value is compared with the value of <paramref name="comparand" /> and possibly replaced by <paramref name="value" />.</param>
<param name="value">The value that replaces the destination value if the comparison results in equality.</param>
<param name="comparand">The value that is compared to the value at <paramref name="location1" />.</param>
<summary>Compares two native-sized signed integers for equality and, if they are equal, replaces the first one, as an atomic operation.</summary>
<returns>The original value in <paramref name="location1" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
Expand Down Expand Up @@ -1216,7 +1216,7 @@ If `comparand` and the object in `location1` are equal by reference, then `value
</Docs>
</Member>
<Member MemberName="CompareExchange">
<MemberSignature Language="C#" Value="public static UIntPtr CompareExchange (ref UIntPtr location1, UIntPtr value, UIntPtr comparand);" />
<MemberSignature Language="C#" Value="public static nuint CompareExchange (ref nuint location1, nuint value, nuint comparand);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig native unsigned int CompareExchange(native unsigned int&amp; location1, native unsigned int value, native unsigned int comparand) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Threading.Interlocked.CompareExchange(System.UIntPtr@,System.UIntPtr,System.UIntPtr)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function CompareExchange (ByRef location1 As UIntPtr, value As UIntPtr, comparand As UIntPtr) As UIntPtr" />
Expand Down Expand Up @@ -1251,10 +1251,10 @@ If `comparand` and the object in `location1` are equal by reference, then `value
<Parameter Name="comparand" Type="System.UIntPtr" Index="2" FrameworkAlternate="net-7.0;net-8.0;net-9.0;net-10.0" />
</Parameters>
<Docs>
<param name="location1">The destination <see cref="T:System.UIntPtr" />, whose value is compared with the value of <paramref name="comparand" /> and possibly replaced by <paramref name="value" />.</param>
<param name="value">The <see cref="T:System.UIntPtr" /> that replaces the destination value if the comparison results in equality.</param>
<param name="comparand">The <see cref="T:System.UIntPtr" /> that is compared to the value at <paramref name="location1" />.</param>
<summary>Compares two platform-specific handles or pointers for equality and, if they are equal, replaces the first one, as an atomic operation.</summary>
<param name="location1">The destination, whose value is compared with the value of <paramref name="comparand" /> and possibly replaced by <paramref name="value" />.</param>
<param name="value">The value that replaces the destination value if the comparison results in equality.</param>
<param name="comparand">The value that is compared to the value at <paramref name="location1" />.</param>
<summary>Compares two native-sized unsigned integers for equality and, if they are equal, replaces the first one, as an atomic operation.</summary>
<returns>The original value in <paramref name="location1" />.</returns>
<remarks>To be added.</remarks>
<exception cref="T:System.NullReferenceException">The address of <paramref name="location1" /> is a <see langword="null" /> pointer.</exception>
Expand Down Expand Up @@ -1867,7 +1867,7 @@ If `comparand` and the value in `location1` are equal by reference, then `value`
</Docs>
</Member>
<Member MemberName="Exchange">
<MemberSignature Language="C#" Value="public static IntPtr Exchange (ref IntPtr location1, IntPtr value);" />
<MemberSignature Language="C#" Value="public static nint Exchange (ref nint location1, nint value);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig native int Exchange(native int&amp; location1, native int value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Threading.Interlocked.Exchange(System.IntPtr@,System.IntPtr)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function Exchange (ByRef location1 As IntPtr, value As IntPtr) As IntPtr" />
Expand Down Expand Up @@ -1919,7 +1919,7 @@ If `comparand` and the value in `location1` are equal by reference, then `value`
<Docs>
<param name="location1">The variable to set to the specified value.</param>
<param name="value">The value to which the <paramref name="location1" /> parameter is set.</param>
<summary>Sets a platform-specific handle or pointer to a specified value and returns the original value, as an atomic operation.</summary>
<summary>Sets a native-sized signed integer to a specified value and returns the original value, as an atomic operation.</summary>
<returns>The original value of <paramref name="location1" />.</returns>
<remarks>To be added.</remarks>
<exception cref="T:System.NullReferenceException">The address of <paramref name="location1" /> is a <see langword="null" /> pointer.</exception>
Expand Down Expand Up @@ -2238,7 +2238,7 @@ If `comparand` and the value in `location1` are equal by reference, then `value`
</Docs>
</Member>
<Member MemberName="Exchange">
<MemberSignature Language="C#" Value="public static UIntPtr Exchange (ref UIntPtr location1, UIntPtr value);" />
<MemberSignature Language="C#" Value="public static nuint Exchange (ref nuint location1, nuint value);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig native unsigned int Exchange(native unsigned int&amp; location1, native unsigned int value) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Threading.Interlocked.Exchange(System.UIntPtr@,System.UIntPtr)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function Exchange (ByRef location1 As UIntPtr, value As UIntPtr) As UIntPtr" />
Expand Down Expand Up @@ -2274,7 +2274,7 @@ If `comparand` and the value in `location1` are equal by reference, then `value`
<Docs>
<param name="location1">The variable to set to the specified value.</param>
<param name="value">The value to which the <paramref name="location1" /> parameter is set.</param>
<summary>Sets a platform-specific handle or pointer to a specified value and returns the original value, as an atomic operation.</summary>
<summary>Sets a native-sized unsigned integer to a specified value and returns the original value, as an atomic operation.</summary>
<returns>The original value of <paramref name="location1" />.</returns>
<remarks>To be added.</remarks>
<exception cref="T:System.NullReferenceException">The address of <paramref name="location1" /> is a <see langword="null" /> pointer.</exception>
Expand Down