What is the Posix equivalent to the Windows InterlockedExchange
?
I have found the equivalent for InterlockedCompareExchange
(i.e. __sync_val_compare_and_swap
) but not simple exchange. I found this answer that gave a solution in assembly, but I need a cross platform/architecture C solution.