Skip to content

Commit 24cf90a

Browse files
committed
add utils_compare_exchange for win
1 parent ded4a20 commit 24cf90a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/utils/utils_concurrency.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ static __inline unsigned char utils_mssb_index(long long value) {
9393
#define utils_fetch_and_add64(ptr, value) \
9494
InterlockedExchangeAdd64((LONG64 *)(ptr), value)
9595

96+
#define utils_compare_exchange(object, expected, desired) \
97+
InterlockedCompareExchange64((LONG64 volatile *)object, expected, desired)
98+
9699
#else // !defined(_WIN32)
97100

98101
#define utils_lssb_index(x) ((unsigned char)__builtin_ctzll(x))

0 commit comments

Comments
 (0)