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