6#if defined(_WIN32) && defined(_MSC_VER)
24 inline static uint32_t
increment(
volatile uint32_t& value, uint32_t byValue = 1) {
25 #if defined(_WIN32) && defined(_MSC_VER)
26 return InterlockedAdd((
volatile long*)&value, (
long)byValue);
28 return __sync_add_and_fetch(&value, byValue);
38 inline static uint32_t
decrement(
volatile uint32_t& value, uint32_t byValue = 1) {
39 #if defined(_WIN32) && defined(_MSC_VER)
40 return InterlockedAdd((
volatile long*)&value, (
long)-byValue);
42 return __sync_sub_and_fetch(&value, byValue);
static uint32_t decrement(volatile uint32_t &value, uint32_t byValue=1)
Decrement uint32 value and return its value.
static uint32_t increment(volatile uint32_t &value, uint32_t byValue=1)
Increment uint32 value and return its value.