summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/core.cpp2
-rw-r--r--src/core/core_timing.cpp6
-rw-r--r--src/core/core_timing.h1
3 files changed, 8 insertions, 1 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index e8936b09d..1d6179a80 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -137,8 +137,8 @@ struct System::Impl {
ResultStatus Pause() {
status = ResultStatus::Success;
- kernel.Suspend(true);
core_timing.SyncPause(true);
+ kernel.Suspend(true);
cpu_manager.Pause(true);
return status;
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp
index cc32a853b..5a7abcfca 100644
--- a/src/core/core_timing.cpp
+++ b/src/core/core_timing.cpp
@@ -77,6 +77,9 @@ void CoreTiming::SyncPause(bool is_paused) {
return;
}
Pause(is_paused);
+ if (!is_paused) {
+ pause_event.Set();
+ }
event.Set();
while (paused_set != is_paused)
;
@@ -197,6 +200,9 @@ void CoreTiming::ThreadLoop() {
wait_set = false;
}
paused_set = true;
+ clock->Pause(true);
+ pause_event.Wait();
+ clock->Pause(false);
}
}
diff --git a/src/core/core_timing.h b/src/core/core_timing.h
index 707c8ef0c..c70b605c8 100644
--- a/src/core/core_timing.h
+++ b/src/core/core_timing.h
@@ -136,6 +136,7 @@ private:
std::shared_ptr<EventType> ev_lost;
Common::Event event{};
+ Common::Event pause_event{};
Common::SpinLock basic_lock{};
Common::SpinLock advance_lock{};
std::unique_ptr<std::thread> timer_thread;