diff options
Diffstat (limited to 'src/common/src/atomic_win32.h')
-rw-r--r-- | src/common/src/atomic_win32.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/common/src/atomic_win32.h b/src/common/src/atomic_win32.h index 31ee0b784..760b16d4d 100644 --- a/src/common/src/atomic_win32.h +++ b/src/common/src/atomic_win32.h @@ -31,40 +31,40 @@ namespace Common { inline void AtomicAdd(volatile u32& target, u32 value) { - InterlockedExchangeAdd((volatile LONG*)&target, (LONG)value); + InterlockedExchangeAdd((volatile LONG*)&target, (LONG)value); } inline void AtomicAnd(volatile u32& target, u32 value) { - _InterlockedAnd((volatile LONG*)&target, (LONG)value); + _InterlockedAnd((volatile LONG*)&target, (LONG)value); } inline void AtomicIncrement(volatile u32& target) { - InterlockedIncrement((volatile LONG*)&target); + InterlockedIncrement((volatile LONG*)&target); } inline void AtomicDecrement(volatile u32& target) { - InterlockedDecrement((volatile LONG*)&target); + InterlockedDecrement((volatile LONG*)&target); } inline u32 AtomicLoad(volatile u32& src) { - return src; // 32-bit reads are always atomic. + return src; // 32-bit reads are always atomic. } inline u32 AtomicLoadAcquire(volatile u32& src) { - u32 result = src; // 32-bit reads are always atomic. - _ReadBarrier(); // Compiler instruction only. x86 loads always have acquire semantics. - return result; + u32 result = src; // 32-bit reads are always atomic. + _ReadBarrier(); // Compiler instruction only. x86 loads always have acquire semantics. + return result; } inline void AtomicOr(volatile u32& target, u32 value) { - _InterlockedOr((volatile LONG*)&target, (LONG)value); + _InterlockedOr((volatile LONG*)&target, (LONG)value); } inline void AtomicStore(volatile u32& dest, u32 value) { - dest = value; // 32-bit writes are always atomic. + dest = value; // 32-bit writes are always atomic. } inline void AtomicStoreRelease(volatile u32& dest, u32 value) { - _WriteBarrier(); // Compiler instruction only. x86 stores always have release semantics. - dest = value; // 32-bit writes are always atomic. + _WriteBarrier(); // Compiler instruction only. x86 stores always have release semantics. + dest = value; // 32-bit writes are always atomic. } } |