5 #include "../core_export.h" 56 static double compare_exchange(
double& location,
double value,
double comparand) noexcept;
77 static void* compare_exchange(
void*& location,
void* value,
void* comparand) noexcept;
83 template<
typename type_t>
84 static type_t
compare_exchange(
object& location,
const object& value,
const object& comparand) noexcept {
85 type_t retValue = location;
87 if (location.equals(comparand)) location = value;
96 template<
typename type_t>
97 static type_t
compare_exchange(type_t& location, type_t value, type_t comparand) noexcept {
98 type_t retValue = location;
100 if (location == comparand) location = value;
109 static float compare_exchange(
float& location,
float value,
float comparand) noexcept;
117 static int32 decrement(
int32& location) noexcept;
121 static int64 decrement(
int64& location) noexcept;
127 template<
typename type_t>
128 static type_t
exchange(type_t& location, type_t value) {
129 type_t original = location;
138 static double exchange(
double& location,
double value) noexcept;
159 static void* exchange(
void*& location,
void* value) noexcept;
164 template<
typename type_t>
165 static type_t
exchange(
object& location,
const object& value) noexcept {
166 type_t original = location;
175 static float exchange(
float& location,
float value) noexcept;
183 static int32 increment(
int32& location) noexcept;
187 static int64 increment(
int64& location) noexcept;
193 static void memory_barrier() noexcept;
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...
Definition: interlocked.h:128
#define static_
This keyword is use to represent a static object. A static object can't be instantiated (constructors...
Definition: static.h:37
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
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...
Definition: interlocked.h:97
#define lock_(object)
The lock_ keyword marks a statement block as a critical section by obtaining the mutual-exclusion loc...
Definition: lock.h:85
__slong__ slong
Represents a 32-bit or 64-bit signed integer.
Definition: types.h:206
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.
Definition: interlocked.h:84
Provides atomic operations for variables that are shared by multiple threads.
Definition: interlocked.h:38
int_least32_t int32
Represents a 32-bit signed integer.
Definition: types.h:129
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.
Definition: interlocked.h:165
int_least64_t int64
Represents a 64-bit signed integer.
Definition: types.h:140