From 8c1f232896abe6b9955679eb7363c349a59a55af Mon Sep 17 00:00:00 2001 From: Matteo Pignataro <matteo.pignataro@skywarder.eu> Date: Sat, 12 Nov 2022 12:38:31 +0100 Subject: [PATCH] [ActiveObject] Turned flags to std::atomic to avoid compiler assumptions --- src/shared/ActiveObject.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/shared/ActiveObject.h b/src/shared/ActiveObject.h index 2d0c2ea82..acfc07e34 100644 --- a/src/shared/ActiveObject.h +++ b/src/shared/ActiveObject.h @@ -25,6 +25,8 @@ #include <diagnostic/SkywardStack.h> #include <miosix.h> +#include <atomic> + namespace Boardcore { @@ -90,8 +92,8 @@ protected: miosix::Thread* thread = nullptr; ///< Gives access to the thread object - bool stopFlag = false; - bool running = false; + std::atomic<bool> stopFlag; + std::atomic<bool> running; private: /** -- GitLab