Using MemoryBarrier() for CPUs not supporting SSE2

This commit is contained in:
BeaR 2013-04-03 11:44:06 +02:00 committed by oy
parent 234a76f0b3
commit 9b81779ae3
2 changed files with 4 additions and 2 deletions

View file

@ -35,6 +35,9 @@
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
#include <intrin.h> #include <intrin.h>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
inline unsigned atomic_inc(volatile unsigned *pValue) inline unsigned atomic_inc(volatile unsigned *pValue)
{ {
return _InterlockedIncrement((volatile long *)pValue); return _InterlockedIncrement((volatile long *)pValue);
@ -52,7 +55,7 @@
inline void sync_barrier() inline void sync_barrier()
{ {
_mm_mfence(); MemoryBarrier();
} }
#else #else
#error missing atomic implementation for this compiler #error missing atomic implementation for this compiler

View file

@ -7,7 +7,6 @@
#include <base/math.h> #include <base/math.h>
#include <base/system.h> #include <base/system.h>
#include <base/tl/threading.h>
#include <engine/client.h> #include <engine/client.h>
#include <engine/config.h> #include <engine/config.h>