Pointer to the integer to swap.
Value to compare
Value to set
The pseudo code for this is
On Windows, atomic CAS is only available for 16, 32, and 64 bit integers, 64 bit is only available on 64 bit Windows.
You are responsible for correctly aligning
x such that the atomic increment works on the hardware you target.
T val = *(&x);
if (val == cmp)
*(&x) = y;
, , , ,
SeqAn - Sequence Analysis Library - www.seqan.de