From a439cdf22ea50f0e39cb51f6dff15fee3b495d16 Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Tue, 10 Mar 2020 11:50:33 -0400 Subject: CPU_Manager: Unload/Reload threads on preemption on SingleCore --- src/core/cpu_manager.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/core/cpu_manager.h') diff --git a/src/core/cpu_manager.h b/src/core/cpu_manager.h index 1e81481ec..ff1935d5c 100644 --- a/src/core/cpu_manager.h +++ b/src/core/cpu_manager.h @@ -5,6 +5,7 @@ #pragma once #include +#include #include #include #include @@ -45,7 +46,7 @@ public: void* GetStartFuncParamater(); std::size_t CurrentCore() const { - return current_core; + return current_core.load(); } private: @@ -88,7 +89,7 @@ private: std::array core_data{}; bool is_multicore{}; - std::size_t current_core{}; + std::atomic current_core{}; std::size_t preemption_count{}; static constexpr std::size_t max_cycle_runs = 5; -- cgit v1.2.3