A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://learn.microsoft.com/en-us/dotnet/api/system.threading.interlocked.add below:

Interlocked.Add Method (System.Threading) | Microsoft Learn

Interlocked.Add Method Definition

Adds two integers and replaces the first integer with the sum, as an atomic operation.

Overloads Add(Int32, Int32)

Adds two 32-bit integers and replaces the first integer with the sum, as an atomic operation.

Add(Int64, Int64)

Adds two 64-bit integers and replaces the first integer with the sum, as an atomic operation.

Add(UInt32, UInt32)

Adds two 32-bit unsigned integers and replaces the first integer with the sum, as an atomic operation.

Add(UInt64, UInt64)

Adds two 64-bit unsigned integers and replaces the first integer with the sum, as an atomic operation.

Add(Int32, Int32)
Source:
Interlocked.CoreCLR.cs
Source:
Interlocked.CoreCLR.cs
Source:
Interlocked.CoreCLR.cs
Source:
Interlocked.CoreCLR.cs

Adds two 32-bit integers and replaces the first integer with the sum, as an atomic operation.

public:
 static int Add(int % location1, int value);
public static int Add(ref int location1, int value);
static member Add : int * int -> int
Public Shared Function Add (ByRef location1 As Integer, value As Integer) As Integer
Parameters
location1
Int32

A variable containing the first value to be added. The sum of the two values is stored in location1.

value
Int32

The value to be added to the integer at location1.

Returns

The new value that was stored at location1 by this operation.

Exceptions

The address of location1 is a null pointer.

Remarks

This method handles an overflow condition by wrapping: if the value at location1 is Int32.MaxValue and value is 1, the result is Int32.MinValue; if value is 2, the result is (Int32.MinValue + 1); and so on. No exception is thrown.

See also Add(UInt32, UInt32)
Source:
Interlocked.cs
Source:
Interlocked.cs
Source:
Interlocked.cs
Source:
Interlocked.cs

Important

This API is not CLS-compliant.

Adds two 32-bit unsigned integers and replaces the first integer with the sum, as an atomic operation.

public:
 static System::UInt32 Add(System::UInt32 % location1, System::UInt32 value);
[System.CLSCompliant(false)]
public static uint Add(ref uint location1, uint value);
[<System.CLSCompliant(false)>]
static member Add : uint32 * uint32 -> uint32
Public Shared Function Add (ByRef location1 As UInteger, value As UInteger) As UInteger
Parameters
location1
UInt32

A variable containing the first value to be added. The sum of the two values is stored in location1.

value
UInt32

The value to be added to the integer at location1.

Returns

The new value that was stored at location1 by this operation.

Attributes
Exceptions

The address of location1 is a null pointer.

Add(UInt64, UInt64)
Source:
Interlocked.cs
Source:
Interlocked.cs
Source:
Interlocked.cs
Source:
Interlocked.cs

Important

This API is not CLS-compliant.

Adds two 64-bit unsigned integers and replaces the first integer with the sum, as an atomic operation.

public:
 static System::UInt64 Add(System::UInt64 % location1, System::UInt64 value);
[System.CLSCompliant(false)]
public static ulong Add(ref ulong location1, ulong value);
[<System.CLSCompliant(false)>]
static member Add : uint64 * uint64 -> uint64
Public Shared Function Add (ByRef location1 As ULong, value As ULong) As ULong
Parameters
location1
UInt64

A variable containing the first value to be added. The sum of the two values is stored in location1.

value
UInt64

The value to be added to the integer at location1.

Returns

The new value that was stored at location1 by this operation.

Attributes
Exceptions

The address of location1 is a null pointer.

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide. In this article

Was this page helpful?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4