summaryrefslogtreecommitdiffstats
path: root/src/core/cpu_manager.h
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2020-03-10 16:50:33 +0100
committerFernando Sahmkow <fsahmkow27@gmail.com>2020-06-27 17:35:43 +0200
commita439cdf22ea50f0e39cb51f6dff15fee3b495d16 (patch)
tree2c88310d7cca08ef451107d9ae6bd5191e7d72e5 /src/core/cpu_manager.h
parentSynchronization: Correct wide Assertion. (diff)
downloadyuzu-a439cdf22ea50f0e39cb51f6dff15fee3b495d16.tar
yuzu-a439cdf22ea50f0e39cb51f6dff15fee3b495d16.tar.gz
yuzu-a439cdf22ea50f0e39cb51f6dff15fee3b495d16.tar.bz2
yuzu-a439cdf22ea50f0e39cb51f6dff15fee3b495d16.tar.lz
yuzu-a439cdf22ea50f0e39cb51f6dff15fee3b495d16.tar.xz
yuzu-a439cdf22ea50f0e39cb51f6dff15fee3b495d16.tar.zst
yuzu-a439cdf22ea50f0e39cb51f6dff15fee3b495d16.zip
Diffstat (limited to 'src/core/cpu_manager.h')
-rw-r--r--src/core/cpu_manager.h5
1 files changed, 3 insertions, 2 deletions
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 <array>
+#include <atomic>
#include <functional>
#include <memory>
#include <thread>
@@ -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<CoreData, Core::Hardware::NUM_CPU_CORES> core_data{};
bool is_multicore{};
- std::size_t current_core{};
+ std::atomic<std::size_t> current_core{};
std::size_t preemption_count{};
static constexpr std::size_t max_cycle_runs = 5;