GCC, for example has __sync_val_compare_and_swap(...) function that give you access to the hardware compare and swap.
GCC, for example has __sync_val_compare_and_swap(...) function that give you access to the hardware compare and swap.