AWS IoT Device SDK C: Platform
Platform portability layer
Return to main page ↑
Atomic_CompareAndSwap_Pointer

Performs an atomic compare-and-swap operation on the given pointers.

static inline uint32_t Atomic_CompareAndSwap_Pointer( void * volatile * pDestination,
void * pNewValue,
void * pComparand )
Parameters
[in,out]pDestinationPointer to the memory location to be loaded and checked.
[in]pNewValueThis value will be written to memory if the comparand matches the value at pDestination.
[in]pComparandThis value is compared to the value at pDestination.
Returns
1 if the newValue was written to pDestination; 0 otherwise.