Atomics on the iphone

When compiling the jucedemo for the iphone (device only, simulator is fine), I’m getting the same error referenced by Bruce here:

except on mac / xcode.

Naturally it works in the simulator (which is x86) but not the device (which is arm6 /arm7).

Ok, I’ll check that asap.

There’s no atomic instruction on ARM9 (I doubt iphone is using ARM6 - or 7).
Under linux, the atomic code is implemented by calling a kernel function pointer from userspace (to avoid process switch cost), see here:

As Iphone doesn’t run linux, either Apple implemented something equivalent, either you can’t use Atomic.
You have to know that ARM9 can’t load a 32bits variable in one shot (no 32 bits read is atomic on ARM9).
So the juce::Atomic class isn’t enough on ARM9 for real atomic operation anyway.

Ok, it looks like the GCC atomics aren’t supported before the 3.2 SDK - I’ll add some fallbacks for building on the old OS versions.

Oh … and I’ll update to 3.2. Hadn’t noticed the update.

Thanks -