Share via


Exchange Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Sets a 32-bit signed integer to a specified value and returns the original value, as an atomic operation.

Namespace:  System.Threading
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public Shared Function Exchange ( _
    ByRef location1 As Integer, _
    value As Integer _
) As Integer
public static int Exchange(
    ref int location1,
    int value
)
public:
static int Exchange(
    int% location1, 
    int value
)
static member Exchange : 
        location1:int byref * 
        value:int -> int 
public static function Exchange(
    location1 : int, 
    value : int
) : int

Parameters

Return Value

Type: System. . :: . .Int32
The original value of location1.

.NET Framework Security

See Also

Reference

Interlocked Class

System.Threading Namespace