From 422c5e0d361e14f648c0871f6ad7a9b4c507f25a Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Sun, 20 Mar 2022 11:48:02 +0000 Subject: [PATCH] The counter in etl::debug_count is atomic, if available --- include/etl/debug_count.h | 5 +++++ support/Release notes.txt | 1 + 2 files changed, 6 insertions(+) diff --git a/include/etl/debug_count.h b/include/etl/debug_count.h index ee606528..1a486490 100644 --- a/include/etl/debug_count.h +++ b/include/etl/debug_count.h @@ -35,6 +35,7 @@ SOFTWARE. #include #include "platform.h" +#include "atomic.h" ///\defgroup debug_count debug count ///\ingroup utilities @@ -111,7 +112,11 @@ namespace etl private: +#if ETL_HAS_ATOMIC + etl::atomic_int32_t count; +#else int32_t count; +#endif }; } diff --git a/support/Release notes.txt b/support/Release notes.txt index 6c5c62ca..66de7620 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -8,6 +8,7 @@ etl::swap is now ETL_CONSTEXPR14. Changed ETL_ENDIANNESS_IS_CONSTEXPR to ETL_HAS_CONSTEXPR_ENDIANNESS. Changed ETL_CONSTEXPR17 to ETL_CONSTEXPR14 for reverse iterators Added template wrappers around memcpy, memmove, memcmp, memset& memchr. +The counter in etl::debug_count is atomic, if available. =============================================================================== 20.25.0