USRP Hardware Driver and USRP Manual  Version: 003.010.002.HEAD-0-gbd6e21dc
UHD and USRP Manual
uhd::atomic_uint32_t Class Reference

A 32-bit integer that can be atomically accessed. More...

#include <uhd/utils/atomic.hpp>

Public Member Functions

UHD_INLINE atomic_uint32_t (void)
 Create a new atomic 32-bit integer, initialized to zero. More...
 
UHD_INLINE uint32_t cas (uint32_t newval, uint32_t cmp)
 Compare with cmp, swap with newval if same, return old value. More...
 
UHD_INLINE void write (const uint32_t newval)
 Sets the atomic integer to a new value. More...
 
UHD_INLINE uint32_t read (void)
 Gets the current value of the atomic integer. More...
 
UHD_INLINE uint32_t inc (void)
 Increment by 1 and return the old value. More...
 
UHD_INLINE uint32_t dec (void)
 Decrement by 1 and return the old value. More...
 

Detailed Description

A 32-bit integer that can be atomically accessed.

Constructor & Destructor Documentation

◆ atomic_uint32_t()

UHD_INLINE uhd::atomic_uint32_t::atomic_uint32_t ( void  )
inline

Create a new atomic 32-bit integer, initialized to zero.

Member Function Documentation

◆ cas()

UHD_INLINE uint32_t uhd::atomic_uint32_t::cas ( uint32_t  newval,
uint32_t  cmp 
)
inline

Compare with cmp, swap with newval if same, return old value.

◆ dec()

UHD_INLINE uint32_t uhd::atomic_uint32_t::dec ( void  )
inline

Decrement by 1 and return the old value.

◆ inc()

UHD_INLINE uint32_t uhd::atomic_uint32_t::inc ( void  )
inline

Increment by 1 and return the old value.

◆ read()

UHD_INLINE uint32_t uhd::atomic_uint32_t::read ( void  )
inline

Gets the current value of the atomic integer.

◆ write()

UHD_INLINE void uhd::atomic_uint32_t::write ( const uint32_t  newval)
inline

Sets the atomic integer to a new value.


The documentation for this class was generated from the following file: