From ffd763d97c2462ddc8c67f1b5712e0ad73725a14 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Sat, 2 Apr 2011 22:49:40 +0000 Subject: [PATCH] new information...x86 allows reads to be reordered with earlier writes to different locations.... add mbarrier for situations where we can't allow this to happen... --- Robust/src/Runtime/mlp_lock.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Robust/src/Runtime/mlp_lock.h b/Robust/src/Runtime/mlp_lock.h index 46d8a930..57bd18ad 100644 --- a/Robust/src/Runtime/mlp_lock.h +++ b/Robust/src/Runtime/mlp_lock.h @@ -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__ -- 2.34.1