Operations which are guaranteed to be atomic.
◆ M_atomic_cas32()
M_bool M_atomic_cas32 |
( |
volatile M_uint32 * |
ptr, |
|
|
M_uint32 |
expected, |
|
|
M_uint32 |
newval |
|
) |
| |
Compare and swap 32bit integer.
- Parameters
-
[in,out] | ptr | Pointer to var to operate on |
[in] | expected | Expected value of var before completing operation |
[in] | newval | Value to set var to |
- Returns
- M_TRUE on success, M_FALSE on failure
◆ M_atomic_cas64()
M_bool M_atomic_cas64 |
( |
volatile M_uint64 * |
ptr, |
|
|
M_uint64 |
expected, |
|
|
M_uint64 |
newval |
|
) |
| |
Compare and swap 64bit integer.
- Parameters
-
[in,out] | ptr | Pointer to var to operate on |
[in] | expected | Expected value of var before completing operation |
[in] | newval | Value to set var to |
- Returns
- M_TRUE on success, M_FALSE on failure
◆ M_atomic_inc_u32()
M_uint32 M_atomic_inc_u32 |
( |
volatile M_uint32 * |
ptr | ) |
|
Increment u32 by 1.
- Parameters
-
[in] | ptr | Pointer to var to operate on. |
- Returns
- The value of pointer before operation.
◆ M_atomic_inc_u64()
M_uint64 M_atomic_inc_u64 |
( |
volatile M_uint64 * |
ptr | ) |
|
Increment u64 by 1.
- Parameters
-
[in] | ptr | Pointer to var to operate on. |
- Returns
- The value of pointer before operation.
◆ M_atomic_dec_u32()
M_uint32 M_atomic_dec_u32 |
( |
volatile M_uint32 * |
ptr | ) |
|
Decrement u32 by 1.
- Parameters
-
[in] | ptr | Pointer to var to operate on. |
- Returns
- The value of pointer before operation.
◆ M_atomic_dec_u64()
M_uint64 M_atomic_dec_u64 |
( |
volatile M_uint64 * |
ptr | ) |
|
Decrement u64 by 1.
- Parameters
-
[in] | ptr | Pointer to var to operate on. |
- Returns
- The value of pointer before operation.
◆ M_atomic_add_u32()
M_uint32 M_atomic_add_u32 |
( |
volatile M_uint32 * |
ptr, |
|
|
M_uint32 |
val |
|
) |
| |
Add a given value with u32.
- Parameters
-
[in] | ptr | Pointer to var to operate on. |
[in] | val | Value to modify ptr with. |
- Returns
- The value of pointer before operation.
◆ M_atomic_add_u64()
M_uint64 M_atomic_add_u64 |
( |
volatile M_uint64 * |
ptr, |
|
|
M_uint64 |
val |
|
) |
| |
Add a given value with u64.
- Parameters
-
[in] | ptr | Pointer to var to operate on. |
[in] | val | Value to modify ptr with. |
- Returns
- The value of pointer before operation.
◆ M_atomic_sub_u32()
M_uint32 M_atomic_sub_u32 |
( |
volatile M_uint32 * |
ptr, |
|
|
M_uint32 |
val |
|
) |
| |
Subtract a given value with u32.
- Parameters
-
[in] | ptr | Pointer to var to operate on. |
[in] | val | Value to modify ptr with. |
- Returns
- The value of pointer before operation.
◆ M_atomic_sub_u64()
M_uint64 M_atomic_sub_u64 |
( |
volatile M_uint64 * |
ptr, |
|
|
M_uint64 |
val |
|
) |
| |
Subtract a given value with u64.
- Parameters
-
[in] | ptr | Pointer to var to operate on. |
[in] | val | Value to modify ptr with. |
- Returns
- The value of pointer before operation.