From 0b2829c793a58540cddb3ff710cb81e114529d8b Mon Sep 17 00:00:00 2001 From: joaquintides Date: Tue, 21 Mar 2023 20:03:35 +0100 Subject: [PATCH] hardened TSan detection --- include/boost/unordered/detail/foa/core.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/boost/unordered/detail/foa/core.hpp b/include/boost/unordered/detail/foa/core.hpp index a84e8592..5d2ad1ee 100644 --- a/include/boost/unordered/detail/foa/core.hpp +++ b/include/boost/unordered/detail/foa/core.hpp @@ -89,6 +89,11 @@ #define BOOST_UNORDERED_HAS_FEATURE(x) 0 #endif +#if BOOST_UNORDERED_HAS_FEATURE(thread_sanitizer)|| \ + defined(__SANITIZE_THREAD__) +#define BOOST_UNORDERED_THREAD_SANITIZER +#endif + #define BOOST_UNORDERED_STATIC_ASSERT_HASH_PRED(Hash, Pred) \ static_assert(boost::is_nothrow_swappable::value, \ "Template parameter Hash is required to be nothrow Swappable."); \ @@ -273,7 +278,7 @@ private: inline __m128i load_si128()const { -#if BOOST_UNORDERED_HAS_FEATURE(thread_sanitizer) +#if defined(BOOST_UNORDERED_THREAD_SANITIZER) /* ThreadSanitizer complains on 1-byte atomic writes combined with * 16-byte atomic reads. */