summaryrefslogtreecommitdiffstats
path: root/src/core/core_timing.h
diff options
context:
space:
mode:
authorMaide <34639600+Kelebek1@users.noreply.github.com>2022-07-28 01:47:06 +0200
committerGitHub <noreply@github.com>2022-07-28 01:47:06 +0200
commit2e461103790110a3deea6425709b1f7f937085ea (patch)
tree495ea29aedfefc3564a87c8c4b44ed199d1aad3a /src/core/core_timing.h
parentimplement pause on system suspend (#8585) (diff)
downloadyuzu-2e461103790110a3deea6425709b1f7f937085ea.tar
yuzu-2e461103790110a3deea6425709b1f7f937085ea.tar.gz
yuzu-2e461103790110a3deea6425709b1f7f937085ea.tar.bz2
yuzu-2e461103790110a3deea6425709b1f7f937085ea.tar.lz
yuzu-2e461103790110a3deea6425709b1f7f937085ea.tar.xz
yuzu-2e461103790110a3deea6425709b1f7f937085ea.tar.zst
yuzu-2e461103790110a3deea6425709b1f7f937085ea.zip
Diffstat (limited to '')
-rw-r--r--src/core/core_timing.h25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/core/core_timing.h b/src/core/core_timing.h
index 09b6ed81a..6aa3ae923 100644
--- a/src/core/core_timing.h
+++ b/src/core/core_timing.h
@@ -5,7 +5,6 @@
#include <atomic>
#include <chrono>
-#include <condition_variable>
#include <functional>
#include <memory>
#include <mutex>
@@ -15,6 +14,7 @@
#include <vector>
#include "common/common_types.h"
+#include "common/thread.h"
#include "common/wall_clock.h"
namespace Core::Timing {
@@ -143,7 +143,7 @@ private:
/// Clear all pending events. This should ONLY be done on exit.
void ClearPendingEvents();
- static void ThreadEntry(CoreTiming& instance, size_t id);
+ static void ThreadEntry(CoreTiming& instance);
void ThreadLoop();
std::unique_ptr<Common::WallClock> clock;
@@ -156,24 +156,21 @@ private:
// accomodated by the standard adaptor class.
std::vector<Event> event_queue;
u64 event_fifo_id = 0;
- std::atomic<size_t> pending_events{};
std::shared_ptr<EventType> ev_lost;
+ Common::Event event{};
+ Common::Event pause_event{};
+ std::mutex basic_lock;
+ std::mutex advance_lock;
+ std::unique_ptr<std::thread> timer_thread;
+ std::atomic<bool> paused{};
+ std::atomic<bool> paused_set{};
+ std::atomic<bool> wait_set{};
+ std::atomic<bool> shutting_down{};
std::atomic<bool> has_started{};
std::function<void()> on_thread_init{};
- std::vector<std::thread> worker_threads;
-
- std::condition_variable event_cv;
- std::condition_variable wait_pause_cv;
- std::condition_variable wait_signal_cv;
- mutable std::mutex event_mutex;
-
- std::atomic<bool> paused_state{};
- bool is_paused{};
- bool shutting_down{};
bool is_multicore{};
- size_t pause_count{};
s64 pause_end_time{};
/// Cycle timing