public class Interlocked { public static int Increment(ref int location); public static int Decrement(ref int location); public static int Exchange(ref int location1, int value); public static int CompareExchange(ref int location1, int value, int comparand); public static float Exchange(ref float location1, float value); public static float CompareExchange(ref float location1, float value, float comparand); public static Object Exchange(ref Object location1, Object value); public static Object CompareExchange(ref Object location1, Object value, Object comparand); }
Compares two values for equality and replaces the destination value if they are equal.
Compares two floating point values for equality and replaces the destination value if they are equal.
Compares two Objects for equality and replaces the destination value if they are equal.
Increments a specified variable as an atomic operation
Decrements a specified variable as an atomic operation.
Sets a variable to a specified value as an atomic operation.
Sets a variable to a specified value as an atomic operation.
Sets an Object variable to a specified value as an atomic operation and returns the original value.