Tip of the day: Do you have threaded OS X desktop code that relies on the ever so handy IncrementAtomic(), CompareAndSwap(), and so forth from DriverSynchronization.h and are wondering how you convert that over to iPhone-usable code, since the CoreServices framework isn’t available?
Well, turns out the solution is easy — everything you’re used to and plenty more besides is available in <libkern/OSAtomic.h> which despite the possibly confusing “libkern” prefix is in no way restricted to kernel code, and is available on both OS X and iPhone. Straight from the renowned Quinn “The Eskimo!” himself. So you know it’s true!
And as an aside, I notice the <libkern/OSByteOrder.h> file also right there, which presumably would be the approved compatible replacements for any Carbon/Cocoa/whatever flavours of endian detection and swapping code might be littering up your source libraries from the 68K days. (We assume you’re not such a newbie as to only have PowerPC vintage code, of course!)
