summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2022-11-26 22:46:38 +0100
committerbunnei <bunneidev@gmail.com>2022-11-26 22:46:38 +0100
commit8f6245be9a344f53cfca6804bf883a491d113dae (patch)
tree76128f03c99dc1f183edece00a4db083ba1c9810 /src
parentMerge pull request #9302 from liamwhite/why-are-we-still-using-ado (diff)
downloadyuzu-8f6245be9a344f53cfca6804bf883a491d113dae.tar
yuzu-8f6245be9a344f53cfca6804bf883a491d113dae.tar.gz
yuzu-8f6245be9a344f53cfca6804bf883a491d113dae.tar.bz2
yuzu-8f6245be9a344f53cfca6804bf883a491d113dae.tar.lz
yuzu-8f6245be9a344f53cfca6804bf883a491d113dae.tar.xz
yuzu-8f6245be9a344f53cfca6804bf883a491d113dae.tar.zst
yuzu-8f6245be9a344f53cfca6804bf883a491d113dae.zip
Diffstat (limited to '')
-rw-r--r--src/core/core.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index d8934be52..94d4e2212 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -189,7 +189,7 @@ struct System::Impl {
kernel.Suspend(false);
core_timing.SyncPause(false);
- is_paused = false;
+ is_paused.store(false, std::memory_order_relaxed);
return status;
}
@@ -200,14 +200,13 @@ struct System::Impl {
core_timing.SyncPause(true);
kernel.Suspend(true);
- is_paused = true;
+ is_paused.store(true, std::memory_order_relaxed);
return status;
}
bool IsPaused() const {
- std::unique_lock lk(suspend_guard);
- return is_paused;
+ return is_paused.load(std::memory_order_relaxed);
}
std::unique_lock<std::mutex> StallProcesses() {
@@ -218,7 +217,7 @@ struct System::Impl {
}
void UnstallProcesses() {
- if (!is_paused) {
+ if (!IsPaused()) {
core_timing.SyncPause(false);
kernel.Suspend(false);
}
@@ -465,7 +464,7 @@ struct System::Impl {
}
mutable std::mutex suspend_guard;
- bool is_paused{};
+ std::atomic_bool is_paused{};
std::atomic<bool> is_shutting_down{};
Timing::CoreTiming core_timing;