File tree 1 file changed +5
-0
lines changed
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) {
83
83
InterlockedExchange64 ((LONG64 volatile *)object, (LONG64)desired)
84
84
#define utils_atomic_increment (object ) \
85
85
InterlockedIncrement64 ((LONG64 volatile *)object)
86
+ #define utils_atomic_decrement (object ) \
87
+ InterlockedDecrement64 ((LONG64 volatile *)object)
86
88
#define utils_fetch_and_add64 (ptr, value ) \
87
89
InterlockedExchangeAdd64 ((LONG64 *)(ptr), value)
88
90
#else
@@ -102,7 +104,10 @@ static __inline unsigned char utils_mssb_index(long long value) {
102
104
103
105
#define utils_atomic_increment (object ) \
104
106
__atomic_add_fetch (object, 1 , __ATOMIC_ACQ_REL)
107
+ #define utils_atomic_decrement (object ) \
108
+ __atomic_sub_fetch (object, 1 , __ATOMIC_ACQ_REL)
105
109
#define utils_fetch_and_add64 __sync_fetch_and_add
110
+
106
111
#endif
107
112
108
113
#ifdef __cplusplus
You can’t perform that action at this time.
0 commit comments