Mono Class Library: System.Threading.Interlocked Overview | Members

System.Threading.Interlocked.Exchange Method

Sets a object reference to refer to a specified object as an atomic operation and returns a reference to the original object.

[System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)]
public static object Exchange (ref object location1, object value)

Parameters

location1
The variable to set.
value
The reference to which location1 is set.

Returns

The original value of location1 .

Exceptions

TypeReason
ArgumentNullExceptionThe address of location1 is null .

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: System.Threading
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0