37 int32 atomic_increment(
int32 volatile *value) {
return InterlockedIncrement(reinterpret_cast<LONG volatile*>(value)); }
38 int64 atomic_increment(
int64 volatile *value) {
return InterlockedIncrement64(value); }
40 int32 atomic_decrement(
int32 volatile *value) {
return InterlockedDecrement(reinterpret_cast<LONG volatile*>(value)); }
41 int64 atomic_decrement(
int64 volatile *value) {
return InterlockedDecrement64(value); }
53 __atomic_thread_fence( __ATOMIC_RELEASE );
61 __atomic_thread_fence( __ATOMIC_ACQUIRE );
68 return __atomic_fetch_add( value, op, __ATOMIC_RELAXED );
73 const int32 old = *value;
81 return __atomic_fetch_add( value, op, __ATOMIC_RELAXED );
94 return __atomic_fetch_add( value, op, __ATOMIC_RELAXED );
99 const int64 old = *value;
106 #if defined(__GNUC__)
107 return __atomic_fetch_add( value, op, __ATOMIC_RELAXED );
112 const uint64 old = *value;
119 #if defined(__GNUC__)
120 return __atomic_fetch_sub( value, op, __ATOMIC_RELAXED );
125 const int32 old = *value;
132 #if defined(__GNUC__)
133 return __atomic_fetch_sub( value, op, __ATOMIC_RELAXED );
138 const uint32 old = *value;
146 #if defined(__GNUC__)
147 return __atomic_fetch_sub( value, op, __ATOMIC_RELAXED );
152 const int64 old = *value;
159 #if defined(__GNUC__)
160 return __atomic_fetch_sub( value, op, __ATOMIC_RELAXED );
165 const uint64 old = *value;
173 #if defined(__GNUC__)
174 return __atomic_fetch_or( value, op, __ATOMIC_RELAXED );
179 const uint32 old = *value;
186 #if defined(__GNUC__)
187 return __atomic_fetch_or( value, op, __ATOMIC_RELAXED );
192 const uint64 old = *value;