Provides atomic operations for variables that are shared by multiple threads.
Public Static Methods | |
static int32 | add (int32 &location, int32 value) noexcept |
Adds two 32-bit integers and replaces the first integer with the sum, as an atomic operation. | |
static int64 | add (int64 &location, int64 value) noexcept |
Adds two 64-bit integers and replaces the first integer with the sum, as an atomic operation. | |
static double | compare_exchange (double &location, double value, double comparand) noexcept |
Compares two Double for equality and, if they are equal, replaces one of the values. | |
static int32 | compare_exchange (int32 &location, int32 value, int32 comparand) noexcept |
Compares two 32-bit signed integers for equality and, if they are equal, replaces one of the values. | |
static int64 | compare_exchange (int64 &location, int64 value, int64 comparand) noexcept |
Compares two 64-bit signed integers for equality and, if they are equal, replaces one of the values. | |
static void * | compare_exchange (void *&location, void *value, void *comparand) noexcept |
Compares two platform-specific handles or pointers for equality and, if they are equal, replaces one of them. | |
template<typename type_t > | |
static type_t | compare_exchange (object &location, const object &value, const object &comparand) noexcept |
Compares two objects for equality and, if they are equal, replaces one of them. | |
template<typename type_t > | |
static type_t | compare_exchange (type_t &location, type_t value, type_t comparand) noexcept |
Compares two instances of the specified reference type type_t for equality and, if they are equal, replaces one of them. | |
static float | compare_exchange (float &location, float value, float comparand) noexcept |
Compares two Single for equality and, if they are equal, replaces one of the values. | |
static int32 | decrement (int32 &location) noexcept |
Decrements a specified variable and stores the result, as an atomic operation. | |
static int64 | decrement (int64 &location) noexcept |
Decrements a specified variable and stores the result, as an atomic operation. | |
template<typename type_t > | |
static type_t | exchange (type_t &location, type_t value) |
Sets a variable of the specified type type_t to a specified value and returns the original value, as an atomic operation. | |
static double | exchange (double &location, double value) noexcept |
Sets a double-precision floating point number to a specified value and returns the original value, as an atomic operation. | |
static int32 | exchange (int32 &location, int32 value) noexcept |
Sets a 32-bit signed integer to a specified value and returns the original value, as an atomic operation. | |
static int64 | exchange (int64 &location, int64 value) noexcept |
Sets a 64-bit signed integer to a specified value and returns the original value, as an atomic operation. | |
static void * | exchange (void *&location, void *value) noexcept |
Sets a platform-specific handles or pointers to a specified value and returns the original value, as an atomic operation. | |
template<typename type_t > | |
static type_t | exchange (object &location, const object &value) noexcept |
Sets an object to a specified value and returns the original value, as an atomic operation. | |
static float | exchange (float &location, float value) noexcept |
Sets a double-precision floating point number to a specified value and returns the original value, as an atomic operation. | |
static int32 | increment (int32 &location) noexcept |
Increments a specified variable and stores the result, as an atomic operation. | |
static int64 | increment (int64 &location) noexcept |
Increments a specified variable and stores the result, as an atomic operation. | |
static void | memory_barrier () noexcept |
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 xtd::threading::interlocked::memory_barrier execute after memory accesses that follow the call to xtd::threading::interlocked::memory_barrier. | |
static int64 | read (int64 &location) noexcept |
Returns a 64-bit value, loaded as an atomic operation. | |
Adds two 32-bit integers and replaces the first integer with the sum, as an atomic operation.
location | A variable containing the first value to be added. The sum of the two values is stored in location. |
value | The value to be added to the integer at location. |
Adds two 64-bit integers and replaces the first integer with the sum, as an atomic operation.
location | A variable containing the first value to be added. The sum of the two values is stored in location. |
value | The value to be added to the integer at location. |
|
staticnoexcept |
Compares two Double for equality and, if they are equal, replaces one of the values.
location | 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 location. |
|
staticnoexcept |
Compares two 32-bit signed integers for equality and, if they are equal, replaces one of the values.
location | 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 location. |
|
staticnoexcept |
Compares two 64-bit signed integers for equality and, if they are equal, replaces one of the values.
location | 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 location. |
|
staticnoexcept |
Compares two platform-specific handles or pointers for equality and, if they are equal, replaces one of them.
location | 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 location. |
|
inlinestaticnoexcept |
Compares two objects for equality and, if they are equal, replaces one of them.
location | 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 location. |
|
inlinestaticnoexcept |
Compares two instances of the specified reference type type_t for equality and, if they are equal, replaces one of them.
location | 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 location. |
|
staticnoexcept |
Compares two Single for equality and, if they are equal, replaces one of the values.
location | 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 location. |
Decrements a specified variable and stores the result, as an atomic operation.
location | The variable whose value is to be decremented. |
Decrements a specified variable and stores the result, as an atomic operation.
location | The variable whose value is to be decremented. |
|
inlinestatic |
Sets a variable of the specified type type_t to a specified value and returns the original value, as an atomic operation.
location | The variable to set to the specified value. |
value | The value to which the location parameter is set. |
|
staticnoexcept |
Sets a double-precision floating point number to a specified value and returns the original value, as an atomic operation.
location | The variable to set to the specified value. |
value | The value to which the location_d parameter is set. |
Sets a 32-bit signed integer to a specified value and returns the original value, as an atomic operation.
location | The variable to set to the specified value. |
value | The value to which the location parameter is set. |
Sets a 64-bit signed integer to a specified value and returns the original value, as an atomic operation.
location | The variable to set to the specified value. |
value | The value to which the location parameter is set. |
|
staticnoexcept |
Sets a platform-specific handles or pointers to a specified value and returns the original value, as an atomic operation.
location | The variable to set to the specified value. |
value | The value to which the location parameter is set. |
|
inlinestaticnoexcept |
Sets an object to a specified value and returns the original value, as an atomic operation.
location | The variable to set to the specified value. |
value | The value to which the location parameter is set. |
|
staticnoexcept |
Sets a double-precision floating point number to a specified value and returns the original value, as an atomic operation.
location | The variable to set to the specified value. |
value | The value to which the location_f parameter is set. |
Increments a specified variable and stores the result, as an atomic operation.
location | The variable whose value is to be incremented. |
Increments a specified variable and stores the result, as an atomic operation.
location | The variable whose value is to be incremented. |
|
staticnoexcept |
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 xtd::threading::interlocked::memory_barrier execute after memory accesses that follow the call to xtd::threading::interlocked::memory_barrier.
Returns a 64-bit value, loaded as an atomic operation.
location | The 64-bit value to be loaded. |