It depends on the compiler compatibility.
If you use GCC on both platforms, you can simply use the GCC atomic primitives, as they are tied to the hardware architecture, not the OS platform.
Otherwise, as PeterK suggested, look at Boost. There is a Boost.Atomic library ; I do not know what his status is when turned on.
source
share