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 @@ -82,6 +82,8 @@ static __inline unsigned char utils_mssb_index(long long value) {
8282 InterlockedExchange64 ((LONG64 volatile *)object, (LONG64)desired)
8383#define utils_atomic_increment (object ) \
8484 InterlockedIncrement64 ((LONG64 volatile *)object)
85+ #define utils_atomic_decrement (object ) \
86+ InterlockedDecrement64 ((LONG64 volatile *)object)
8587#define utils_fetch_and_add64 (ptr, value ) \
8688 InterlockedExchangeAdd64 ((LONG64 *)(ptr), value)
8789#else
@@ -101,7 +103,10 @@ static __inline unsigned char utils_mssb_index(long long value) {
101103
102104#define utils_atomic_increment (object ) \
103105 __atomic_add_fetch (object, 1 , __ATOMIC_ACQ_REL)
106+ #define utils_atomic_decrement (object ) \
107+ __atomic_sub_fetch (object, 1 , __ATOMIC_ACQ_REL)
104108#define utils_fetch_and_add64 __sync_fetch_and_add
109+
105110#endif
106111
107112#ifdef __cplusplus
You can’t perform that action at this time.
0 commit comments