From edc52250b8157a9d2b8c909225114c98c7ea609e Mon Sep 17 00:00:00 2001 From: bunnei Date: Mon, 7 May 2018 22:57:39 -0400 Subject: core: Run all CPU cores separately, even in single-thread mode. --- src/core/core.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/core/core.h') diff --git a/src/core/core.h b/src/core/core.h index 5740e858b..6de707271 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -160,13 +160,8 @@ public: } private: - /// Returns the current CPU core based on the calling host thread - Cpu& CurrentCpuCore() { - const auto& search = thread_to_cpu.find(std::this_thread::get_id()); - ASSERT(search != thread_to_cpu.end()); - ASSERT(search->second); - return *search->second; - } + /// Returns the currently running CPU core + Cpu& CurrentCpuCore(); /** * Initialize the emulated system. @@ -184,6 +179,7 @@ private: std::shared_ptr cpu_barrier; std::array, NUM_CPU_CORES> cpu_cores; std::array, NUM_CPU_CORES - 1> cpu_core_threads; + size_t active_core{}; ///< Active core, only used in single thread mode /// Service manager std::shared_ptr service_manager; -- cgit v1.2.3