mscorlib(4.0.0.0) API with additions
|
Provides atomic operations for variables that are shared by multiple threads. More...
Public Member Functions | |
static int | Exchange (ref int location1, int value) |
Sets a 32-bit signed integer to a specified value and returns the original value, as an atomic operation. More... | |
static long | Exchange (ref long location1, long value) |
Sets a 64-bit signed integer to a specified value and returns the original value, as an atomic operation. More... | |
static float | Exchange (ref float location1, float value) |
Sets a single-precision floating point number to a specified value and returns the original value, as an atomic operation. More... | |
static double | Exchange (ref double location1, double value) |
Sets a double-precision floating point number to a specified value and returns the original value, as an atomic operation. More... | |
static object | Exchange (ref object location1, object value) |
Sets an object to a specified value and returns a reference to the original object, as an atomic operation. More... | |
static IntPtr | Exchange (ref IntPtr location1, IntPtr value) |
Sets a platform-specific handle or pointer to a specified value and returns the original value, as an atomic operation. More... | |
static int | CompareExchange (ref int location1, int value, int comparand) |
Compares two 32-bit signed integers for equality and, if they are equal, replaces the first value. More... | |
static long | CompareExchange (ref long location1, long value, long comparand) |
Compares two 64-bit signed integers for equality and, if they are equal, replaces the first value. More... | |
static float | CompareExchange (ref float location1, float value, float comparand) |
Compares two single-precision floating point numbers for equality and, if they are equal, replaces the first value. More... | |
static double | CompareExchange (ref double location1, double value, double comparand) |
Compares two double-precision floating point numbers for equality and, if they are equal, replaces the first value. More... | |
static object | CompareExchange (ref object location1, object value, object comparand) |
Compares two objects for reference equality and, if they are equal, replaces the first object. More... | |
static IntPtr | CompareExchange (ref IntPtr location1, IntPtr value, IntPtr comparand) |
Compares two platform-specific handles or pointers for equality and, if they are equal, replaces the first one. More... | |
Static Public Member Functions | |
static int | Increment (ref int location) |
Increments a specified variable and stores the result, as an atomic operation. More... | |
static long | Increment (ref long location) |
Increments a specified variable and stores the result, as an atomic operation. More... | |
static int | Decrement (ref int location) |
Decrements a specified variable and stores the result, as an atomic operation. More... | |
static long | Decrement (ref long location) |
Decrements the specified variable and stores the result, as an atomic operation. More... | |
static T | Exchange< T > (ref T location1, T value) |
Sets a variable of the specified type T to a specified value and returns the original value, as an atomic operation. More... | |
static T | CompareExchange< T > (ref T location1, T value, T comparand) |
Compares two instances of the specified reference type T for equality and, if they are equal, replaces the first one. More... | |
static int | Add (ref int location1, int value) |
Adds two 32-bit integers and replaces the first integer with the sum, as an atomic operation. More... | |
static long | Add (ref long location1, long value) |
Adds two 64-bit integers and replaces the first integer with the sum, as an atomic operation. More... | |
static long | Read (ref long location) |
Returns a 64-bit value, loaded as an atomic operation. More... | |
static void | MemoryBarrier () |
Synchronizes memory access as follows: The processor that executes the current thread cannot reorder instructions in such a way that memory accesses before the call to M:System.Threading.Interlocked.MemoryBarrier execute after memory accesses that follow the call to M:System.Threading.Interlocked.MemoryBarrier. More... | |
Provides atomic operations for variables that are shared by multiple threads.
Definition at line 10 of file Interlocked.cs.
|
static |
Adds two 32-bit integers and replaces the first integer with the sum, as an atomic operation.
location1 | A variable containing the first value to be added. The sum of the two values is stored in location1 . |
value | The value to be added to the integer at location1 . |
T:System.NullReferenceException | The address of location1 is a null pointer. |
Definition at line 247 of file Interlocked.cs.
|
static |
Adds two 64-bit integers and replaces the first integer with the sum, as an atomic operation.
location1 | A variable containing the first value to be added. The sum of the two values is stored in location1 . |
value | The value to be added to the integer at location1 . |
T:System.NullReferenceException | The address of location1 is a null pointer. |
Definition at line 259 of file Interlocked.cs.
static int System.Threading.Interlocked.CompareExchange | ( | ref int | location1, |
int | value, | ||
int | comparand | ||
) |
Compares two 32-bit signed integers for equality and, if they are equal, replaces the first value.
location1 | The destination, whose value is compared with comparand and possibly replaced. |
value | The value that replaces the destination value if the comparison results in equality. |
comparand | The value that is compared to the value at location1 . |
T:System.NullReferenceException | The address of location1 is a null pointer. |
static long System.Threading.Interlocked.CompareExchange | ( | ref long | location1, |
long | value, | ||
long | comparand | ||
) |
Compares two 64-bit signed integers for equality and, if they are equal, replaces the first value.
location1 | The destination, whose value is compared with comparand and possibly replaced. |
value | The value that replaces the destination value if the comparison results in equality. |
comparand | The value that is compared to the value at location1 . |
T:System.NullReferenceException | The address of location1 is a null pointer. |
static float System.Threading.Interlocked.CompareExchange | ( | ref float | location1, |
float | value, | ||
float | comparand | ||
) |
Compares two single-precision floating point numbers for equality and, if they are equal, replaces the first value.
location1 | The destination, whose value is compared with comparand and possibly replaced. |
value | The value that replaces the destination value if the comparison results in equality. |
comparand | The value that is compared to the value at location1 . |
T:System.NullReferenceException | The address of location1 is a null pointer. |
static double System.Threading.Interlocked.CompareExchange | ( | ref double | location1, |
double | value, | ||
double | comparand | ||
) |
Compares two double-precision floating point numbers for equality and, if they are equal, replaces the first value.
location1 | The destination, whose value is compared with comparand and possibly replaced. |
value | The value that replaces the destination value if the comparison results in equality. |
comparand | The value that is compared to the value at location1 . |
T:System.NullReferenceException | The address of location1 is a null pointer. |
static object System.Threading.Interlocked.CompareExchange | ( | ref object | location1, |
object | value, | ||
object | comparand | ||
) |
Compares two objects for reference equality and, if they are equal, replaces the first object.
location1 | The destination object that is compared with comparand and possibly replaced. |
value | The object that replaces the destination object if the comparison results in equality. |
comparand | The object that is compared to the object at location1 . |
T:System.ArgumentNullException | The address of location1 is a null pointer. |
static IntPtr System.Threading.Interlocked.CompareExchange | ( | ref IntPtr | location1, |
IntPtr | value, | ||
IntPtr | comparand | ||
) |
Compares two platform-specific handles or pointers for equality and, if they are equal, replaces the first one.
location1 | The destination T:System.IntPtr, whose value is compared with the value of comparand and possibly replaced by value . |
value | The T:System.IntPtr that replaces the destination value if the comparison results in equality. |
comparand | The T:System.IntPtr that is compared to the value at location1 . |
T:System.NullReferenceException | The address of location1 is a null pointer. |
|
static |
Compares two instances of the specified reference type T for equality and, if they are equal, replaces the first one.
location1 | The destination, whose value is compared with comparand and possibly replaced. This is a reference parameter (ref in C#, ByRef in Visual Basic). |
value | The value that replaces the destination value if the comparison results in equality. |
comparand | The value that is compared to the value at location1 . |
T | The type to be used for location1 , value , and comparand . This type must be a reference type. |
T:System.NullReferenceException | The address of location1 is a null pointer. |
T | : | class |
Definition at line 217 of file Interlocked.cs.
|
static |
Decrements a specified variable and stores the result, as an atomic operation.
location | The variable whose value is to be decremented. |
T:System.ArgumentNullException | The address of location is a null pointer. |
Definition at line 40 of file Interlocked.cs.
|
static |
Decrements the specified variable and stores the result, as an atomic operation.
location | The variable whose value is to be decremented. |
T:System.ArgumentNullException | The address of location is a null pointer. |
Definition at line 50 of file Interlocked.cs.
static int System.Threading.Interlocked.Exchange | ( | ref int | location1, |
int | value | ||
) |
Sets a 32-bit signed integer to a specified value and returns the original value, as an atomic operation.
location1 | The variable to set to the specified value. |
value | The value to which the location1 parameter is set. |
T:System.ArgumentNullException | The address of location1 is a null pointer. |
static long System.Threading.Interlocked.Exchange | ( | ref long | location1, |
long | value | ||
) |
Sets a 64-bit signed integer to a specified value and returns the original value, as an atomic operation.
location1 | The variable to set to the specified value. |
value | The value to which the location1 parameter is set. |
T:System.NullReferenceException | The address of location1 is a null pointer. |
static float System.Threading.Interlocked.Exchange | ( | ref float | location1, |
float | value | ||
) |
Sets a single-precision floating point number to a specified value and returns the original value, as an atomic operation.
location1 | The variable to set to the specified value. |
value | The value to which the location1 parameter is set. |
T:System.NullReferenceException | The address of location1 is a null pointer. |
static double System.Threading.Interlocked.Exchange | ( | ref double | location1, |
double | value | ||
) |
Sets a double-precision floating point number to a specified value and returns the original value, as an atomic operation.
location1 | The variable to set to the specified value. |
value | The value to which the location1 parameter is set. |
T:System.NullReferenceException | The address of location1 is a null pointer. |
static object System.Threading.Interlocked.Exchange | ( | ref object | location1, |
object | value | ||
) |
Sets an object to a specified value and returns a reference to the original object, as an atomic operation.
location1 | The variable to set to the specified value. |
value | The value to which the location1 parameter is set. |
T:System.ArgumentNullException | The address of location1 is a null pointer. |
Sets a platform-specific handle or pointer to a specified value and returns the original value, as an atomic operation.
location1 | The variable to set to the specified value. |
value | The value to which the location1 parameter is set. |
T:System.NullReferenceException | The address of location1 is a null pointer. |
|
static |
Sets a variable of the specified type T to a specified value and returns the original value, as an atomic operation.
location1 | The variable to set to the specified value. This is a reference parameter (ref in C#, ByRef in Visual Basic). |
value | The value to which the location1 parameter is set. |
T | The type to be used for location1 and value . This type must be a reference type. |
T:System.NullReferenceException | The address of location1 is a null pointer. |
T | : | class |
Definition at line 127 of file Interlocked.cs.
|
static |
Increments a specified variable and stores the result, as an atomic operation.
location | The variable whose value is to be incremented. |
T:System.NullReferenceException | The address of location is a null pointer. |
Definition at line 18 of file Interlocked.cs.
|
static |
Increments a specified variable and stores the result, as an atomic operation.
location | The variable whose value is to be incremented. |
T:System.NullReferenceException | The address of location is a null pointer. |
Definition at line 29 of file Interlocked.cs.
|
static |
Synchronizes memory access as follows: The processor that executes the current thread cannot reorder instructions in such a way that memory accesses before the call to M:System.Threading.Interlocked.MemoryBarrier execute after memory accesses that follow the call to M:System.Threading.Interlocked.MemoryBarrier.
Definition at line 276 of file Interlocked.cs.
|
static |
Returns a 64-bit value, loaded as an atomic operation.
location | The 64-bit value to be loaded. |
Definition at line 268 of file Interlocked.cs.