summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2014-01-04 01:04:11 -0800
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2014-01-04 01:04:11 -0800
commit3f5d360b8421502a2e933211d9463b74d27bb7e0 (patch)
tree2588762776a21b622d238bffaa065501bb7d6587
parent3a472fbe68ce79f79953d1acf0616c0af0dda390 (diff)
Fixing Win32 deadlock.Balau-changes
Memory barriers and read-write barriers aren't the same thing. The former are CPU-barriers, while the latter are compiler-barriers. Using a compiler-barrier won't prevent you from CPU desynchronization.
-rw-r--r--ev.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ev.c b/ev.c
index c8e7fb2..741d164 100644
--- a/ev.c
+++ b/ev.c
@@ -664,9 +664,9 @@ struct signalfd_siginfo
#define ECB_MEMORY_FENCE __sync_synchronize ()
#elif _MSC_VER >= 1400 /* VC++ 2005 */
#pragma intrinsic(_ReadBarrier,_WriteBarrier,_ReadWriteBarrier)
- #define ECB_MEMORY_FENCE _ReadWriteBarrier ()
- #define ECB_MEMORY_FENCE_ACQUIRE _ReadWriteBarrier () /* according to msdn, _ReadBarrier is not a load fence */
- #define ECB_MEMORY_FENCE_RELEASE _WriteBarrier ()
+ #define ECB_MEMORY_FENCE _ReadWriteBarrier (); MemoryBarrier()
+ #define ECB_MEMORY_FENCE_ACQUIRE _ReadWriteBarrier (); MemoryBarrier() /* according to msdn, _ReadBarrier is not a load fence */
+ #define ECB_MEMORY_FENCE_RELEASE _WriteBarrier (); MemoryBarrier()
#elif defined _WIN32
#include <WinNT.h>
#define ECB_MEMORY_FENCE MemoryBarrier () /* actually just xchg on x86... scary */