diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2014-01-04 01:04:11 -0800 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2014-01-04 01:04:11 -0800 |
commit | 3f5d360b8421502a2e933211d9463b74d27bb7e0 (patch) | |
tree | 2588762776a21b622d238bffaa065501bb7d6587 /ev.c | |
parent | 3a472fbe68ce79f79953d1acf0616c0af0dda390 (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.
Diffstat (limited to 'ev.c')
-rw-r--r-- | ev.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 */ |