From 4baffaae66d9c2af0cbafa12cac6903811ed2bdf Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 21 Aug 2022 15:04:47 +0200 Subject: [PATCH] Migrate to modern TBB version --- include/util/packed_vector.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/util/packed_vector.hpp b/include/util/packed_vector.hpp index c6c08b86c26..fcd74fc0980 100644 --- a/include/util/packed_vector.hpp +++ b/include/util/packed_vector.hpp @@ -16,7 +16,7 @@ #include #if defined(_MSC_VER) -// for `InterlockedCompareExchange` +// for `InterlockedCompareExchange64` #include #endif @@ -95,7 +95,7 @@ inline WordT set_upper_value(WordT word, WordT mask, std::uint8_t offset, T valu inline bool compare_and_swap(uint64_t *ptr, uint64_t old_value, uint64_t new_value) { #if defined(_MSC_VER) - return InterlockedCompareExchange(ptr, new_value, old_value) != old_value; + return InterlockedCompareExchange64(ptr, new_value, old_value) == old_value; #elif defined(__GNUC__) return __sync_bool_compare_and_swap(ptr, old_value, new_value); #else