+#if defined(__APPLE__)
+#include <libkern/OSAtomic.h>
+#define MEMORY_BARRIER() OSMemoryBarrier()
+#elif (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)
+#define MEMORY_BARRIER() __sync_synchronize()
+#else
+#warning SMP Danger: memory barriers are not supported on this system
+#endif
there was a buggy gcc version, that didn't implement
__sync_synchronize() correctly on x86, causing errors on nehalem
machines (which don't have a shared cache).
if sse is enabled, _mm_mfence() can be used to work around this compiler
bug ...
tim
--
tim(a)klingt.org
http://tim.klingt.org
/"\ ASCII Ribbon Campaign
\ / no HTML in email & vCards
X no proprietary attachments
/ \ use open standards