Compares two object variables for equality and stores a specified object
if they are equal.
[Edit]
[System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)] public static object CompareExchange (ref object location1, object value, object comparand) |
|
Parameters
- location1
- A object reference that is set to value if the object to which it refers is equal to comparand.
[Edit]
- value
- The reference that will replace the value of location1 if location1 and comparand are equal.
[Edit]
- comparand
- An object to be compared to that referred to by location1.
[Edit]
Returns
A object containing the original value of location1.
[Edit]
Exceptions
Remarks
Requirements
Namespace: System.Threading
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0