File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,8 @@ static __inline unsigned char utils_mssb_index(long long value) {
8383 InterlockedExchange64 ((LONG64 volatile *)object, (LONG64)desired)
8484#define utils_atomic_increment (object ) \
8585 InterlockedIncrement64 ((LONG64 volatile *)object)
86+ #define utils_atomic_decrement (object ) \
87+ InterlockedDecrement64 ((LONG64 volatile *)object)
8688#define utils_fetch_and_add64 (ptr, value ) \
8789 InterlockedExchangeAdd64 ((LONG64 *)(ptr), value)
8890#else
@@ -102,7 +104,10 @@ static __inline unsigned char utils_mssb_index(long long value) {
102104
103105#define utils_atomic_increment (object ) \
104106 __atomic_add_fetch (object, 1 , __ATOMIC_ACQ_REL)
107+ #define utils_atomic_decrement (object ) \
108+ __atomic_sub_fetch (object, 1 , __ATOMIC_ACQ_REL)
105109#define utils_fetch_and_add64 __sync_fetch_and_add
110+
106111#endif
107112
108113#ifdef __cplusplus
You can’t perform that action at this time.
0 commit comments