From 91a957a6c83b1fbc0f3cd373ba889f5a459ee660 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 29 Jul 2011 12:17:26 +0000 Subject: *** empty log message *** --- ev.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ev.c b/ev.c index 00797d2..3731cc3 100644 --- a/ev.c +++ b/ev.c @@ -499,7 +499,7 @@ struct signalfd_siginfo #if __x86 #define ECB_MEMORY_FENCE __asm__ __volatile__ ("lock; orb $0, -1(%%esp)" : : : "memory") #define ECB_MEMORY_FENCE_ACQUIRE ECB_MEMORY_FENCE - #define ECB_MEMORY_FENCE_RELEASE ECB_MEMORY_FENCE + #define ECB_MEMORY_FENCE_RELEASE ECB_MEMORY_FENCE /* better be safe than sorry */ #elif __amd64 #define ECB_MEMORY_FENCE __asm__ __volatile__ ("mfence" : : : "memory") #define ECB_MEMORY_FENCE_ACQUIRE __asm__ __volatile__ ("lfence" : : : "memory") @@ -513,7 +513,12 @@ struct signalfd_siginfo #define ECB_MEMORY_FENCE __sync_synchronize () #define ECB_MEMORY_FENCE_ACQUIRE ({ char dummy = 0; __sync_lock_test_and_set (&dummy, 1); }) #define ECB_MEMORY_FENCE_RELEASE ({ char dummy = 1; __sync_lock_release (&dummy ); }) - #elif defined(_WIN32) && defined(MemoryBarrier) + #elif _MSC_VER >= 1400 && 0 /* TODO: only true when using volatiles */ + #define ECB_MEMORY_FENCE do { } while (0) + #define ECB_MEMORY_FENCE_ACQUIRE ECB_MEMORY_FENCE + #define ECB_MEMORY_FENCE_RELEASE ECB_MEMORY_FENCE + #elif defined(_WIN32) + #include #define ECB_MEMORY_FENCE MemoryBarrier () #define ECB_MEMORY_FENCE_ACQUIRE ECB_MEMORY_FENCE #define ECB_MEMORY_FENCE_RELEASE ECB_MEMORY_FENCE -- cgit v1.2.3