Compares two int values for equality and stores a
specified value if they are equal.
[System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)]
public static
int CompareExchange (
ref int location1,
int value,
int comparand)
- location1
- A int reference whose value is updated with value if the original value of location1 is equal to comparand.
- value
- A int whose value will replace the value of location1 if location1 and comparand are equal.
- comparand
- A int to be compared to location1.
The original value of location1.
Namespace: System.Threading
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0