Collapse AllExpand All      Code: All Code: Multiple Code: Visual Basic Code: C# Code: Visual C++ Code: F# Code: JScript 
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)
Public Shared Function Exchange ( _
	ByRef location1 As Integer, _
	value As Integer _
) As Integer
public static int Exchange(
	ref int location1,
	int value
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


Type: System..::..Int32%
The variable to set to the specified value.
Type: System..::..Int32
The value to which the location1 parameter is set.

Return Value

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