NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Interlocked Reference

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);
}

CompareExchange – int

Compares two values for equality and replaces the destination value if they are equal.

CompareExchange – float

Compares two floating point values for equality and replaces the destination value if they are equal.

CompareExchange – object

Compares two Objects for equality and replaces the destination value if they are equal.

Increment

Increments a specified variable as an atomic operation

Decrement

Decrements a specified variable as an atomic operation.

Exchange – int

Sets a variable to a specified value as an atomic operation.

Exchange – float

Sets a variable to a specified value as an atomic operation.

Exchange - object

Sets an Object variable to a specified value as an atomic operation and returns the original value.