_InterlockedCompareExchange32
and _InterlockedIncrement32
, which are implemented through the assembly instructions lock cmpxchg
and lock xadd
, respectively.
Looking at the documentation on MSDN, in the ARM Intrinsics section, I read that the Microsoft compiler also has these two intrinsic functions for the ARM architecture.
Obviously, these functions in the ARM architecture will not be overridden by the assembly instructions lock cmpxchg
and lock xadd
, since it does not have such instructions.
How to implement the _InterlockedCompareExchange32
and _InterlockedIncrement32
functions (can it be in C or in assembly), so that it is compileable by the ARM compiler that comes with the Android NDK?