site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com On Jan 18, 2010, at 11:04 AM, Derek Darwin Lists wrote:
I believe you are misreading/mistranslating the x86 assembly implementation of OSAtomicAnd32. The compare and swap operation (cmpxchg) in the "commpage" will populate GPR EAX with the value in memory on a mismatch, so the loop on failure will restart with the "latest" value of the memory operand after the failed comparison.
That's right. You can't do that with C code and OSAtomicCompareAndSwap(), but x86 OSAtomicAnd32() is built atop other assembly code that is not identical to OSAtomicCompareAndSwap(). -- Greg Parker gparker@apple.com Runtime Wrangler _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com