Share via


Interlocked.Exchange Method (Int64%, Int64)

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Sets a 64-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
<SecuritySafeCriticalAttribute> _
Public Shared Function Exchange ( _
    ByRef location1 As Long, _
    value As Long _
) As Long
[SecuritySafeCriticalAttribute]
public static long Exchange(
    ref long location1,
    long value
)

Parameters

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

Return Value

Type: System.Int64
The original value of location1.

Exceptions

Exception Condition
NullReferenceException

The address of location1 is a null pointer.

Remarks

Version Notes

Silverlight for Windows Phone Silverlight for Windows Phone

 64-bit members of the Interlocked class are present but not supported.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.