41 #ifndef _atomic_black_ops_would_be_an_awesome_name_for_a_cheezy_game_cpp
42 #define _atomic_black_ops_would_be_an_awesome_name_for_a_cheezy_game_cpp
56 #ifdef _MEZZ_THREAD_WIN32_
57 return InterlockedCompareExchange((
long*)VariableToChange,NewValue,OldValue);
59 return __sync_val_compare_and_swap(VariableToChange,OldValue,NewValue);
77 #ifdef _MEZZ_THREAD_WIN32_
78 return InterlockedExchangeAdd((
long*)VariableToChange, Value);
81 return __sync_fetch_and_add(VariableToChange,Value);
int32_t Int32
An 32-bit integer.
Int32 AtomicAdd(Int32 *VariableToChange, Int32 Value)
Increments a value in a way guaranteed to not lose any atomic increments.
Int32 AtomicCompareAndSwap32(Int32 *VariableToChange, const Int32 &OldValue, const Int32 &NewValue)
Atomically Compares And Swaps a 32 bit value.
Simple thread safe ways to check and change a specified variable atomically.
The bulk of the engine components go in this namspace.