new information...x86 allows reads to be reordered with earlier writes to different...
authorbdemsky <bdemsky>
Sat, 2 Apr 2011 22:49:40 +0000 (22:49 +0000)
committerbdemsky <bdemsky>
Sat, 2 Apr 2011 22:49:40 +0000 (22:49 +0000)
add mbarrier for situations where we can't allow this to happen...

Robust/src/Runtime/mlp_lock.h

index 46d8a930797aa9e482a0638ea30f7ccc65ebdf52..57bd18ad1f9335c123225eef5718973877a87431 100644 (file)
@@ -11,6 +11,7 @@
 #define __xg(x) ((volatile INTPTR *)(x))
 
 #define CFENCE   asm volatile("":::"memory");
+#define MFENCE   asm volatile("mfence":::"memory");
 
 #define LOCK_PREFIX \
   ".section .smp_locks,\"a\"\n"   \
@@ -117,5 +118,10 @@ static inline int BARRIER(){
   return 1;
 }
 
+static inline int MBARRIER(){
+  MFENCE;
+  return 1;
+}
+
 
 #endif // ____MLP_LOCK_H__