Content-type: text/html
unsigned RTAtomic_CompareAndSwap (volatile unsigned *value, unsigned old_value, unsigned new_value);
unsigned RTAtomic_Add_Return(int i, volatile unsigned int *p);
unsigned long RTAtomic_AtomicSwap(volatile unsigned long *p, unsigned long v);
void * RTAtomic_AtomicSwapPointer(volatile void *p, void *value);
RTAtomic_CompareAndSwap takes a new_value and if the value at *value is old_value, it will conditionally, atomically swap *value and new_value. The return value is true if the swap took place.
RTAtomic_Add_Return atomically increments the *p by i. The simple increment case can be constructed by making i=1.
RTAtomic_AtomicSwap and RTAtomic_AtomicSwapPointer unconditionally and atomically swap the content of pointer p and a value argument of an unsigned long or void pointer, respectively.
RTAtomic is a core Chronolytix function.