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

System.Threading.Interlocked.CompareExchange Method

Compares two float values for equality and stores a specified value if they are equal. [Edit]

public static float CompareExchange (ref float location1, float value, float comparand)

Parameters

location1
A float whose value is updated with value if its original value is equal to comparand. [Edit]
value
The float value that will replace value of location1 if location1 and comparand are equal. [Edit]
comparand
A float to be compared to location1. [Edit]

Returns

A float containing the original value of location1. [Edit]

Exceptions

TypeReason
ArgumentNullExceptionThe address of location1 is null . [Edit]

Remarks

The compare and store operations are performed as an atomic operation. [Edit]

Requirements

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