Mstdlib-1.24.0

Functions

M_bool M_atomic_cas32 (volatile M_uint32 *ptr, M_uint32 expected, M_uint32 newval)
 
M_bool M_atomic_cas64 (volatile M_uint64 *ptr, M_uint64 expected, M_uint64 newval)
 
M_uint32 M_atomic_inc_u32 (volatile M_uint32 *ptr)
 
M_uint64 M_atomic_inc_u64 (volatile M_uint64 *ptr)
 
M_uint32 M_atomic_dec_u32 (volatile M_uint32 *ptr)
 
M_uint64 M_atomic_dec_u64 (volatile M_uint64 *ptr)
 
M_uint32 M_atomic_add_u32 (volatile M_uint32 *ptr, M_uint32 val)
 
M_uint64 M_atomic_add_u64 (volatile M_uint64 *ptr, M_uint64 val)
 
M_uint32 M_atomic_sub_u32 (volatile M_uint32 *ptr, M_uint32 val)
 
M_uint64 M_atomic_sub_u64 (volatile M_uint64 *ptr, M_uint64 val)
 

Detailed Description

Operations which are guaranteed to be atomic.

Function Documentation

◆ 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]ptrPointer to var to operate on
[in]expectedExpected value of var before completing operation
[in]newvalValue 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]ptrPointer to var to operate on
[in]expectedExpected value of var before completing operation
[in]newvalValue 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]ptrPointer 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]ptrPointer 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]ptrPointer 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]ptrPointer 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]ptrPointer to var to operate on.
[in]valValue 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]ptrPointer to var to operate on.
[in]valValue 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]ptrPointer to var to operate on.
[in]valValue 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]ptrPointer to var to operate on.
[in]valValue to modify ptr with.
Returns
The value of pointer before operation.