diff options
Diffstat (limited to 'src/core/core_timing.h')
| -rw-r--r-- | src/core/core_timing.h | 25 |
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 @@ | |||
| 5 | 5 | ||
| 6 | #include <atomic> | 6 | #include <atomic> |
| 7 | #include <chrono> | 7 | #include <chrono> |
| 8 | #include <condition_variable> | ||
| 9 | #include <functional> | 8 | #include <functional> |
| 10 | #include <memory> | 9 | #include <memory> |
| 11 | #include <mutex> | 10 | #include <mutex> |
| @@ -15,6 +14,7 @@ | |||
| 15 | #include <vector> | 14 | #include <vector> |
| 16 | 15 | ||
| 17 | #include "common/common_types.h" | 16 | #include "common/common_types.h" |
| 17 | #include "common/thread.h" | ||
| 18 | #include "common/wall_clock.h" | 18 | #include "common/wall_clock.h" |
| 19 | 19 | ||
| 20 | namespace Core::Timing { | 20 | namespace Core::Timing { |
| @@ -143,7 +143,7 @@ private: | |||
| 143 | /// Clear all pending events. This should ONLY be done on exit. | 143 | /// Clear all pending events. This should ONLY be done on exit. |
| 144 | void ClearPendingEvents(); | 144 | void ClearPendingEvents(); |
| 145 | 145 | ||
| 146 | static void ThreadEntry(CoreTiming& instance, size_t id); | 146 | static void ThreadEntry(CoreTiming& instance); |
| 147 | void ThreadLoop(); | 147 | void ThreadLoop(); |
| 148 | 148 | ||
| 149 | std::unique_ptr<Common::WallClock> clock; | 149 | std::unique_ptr<Common::WallClock> clock; |
| @@ -156,24 +156,21 @@ private: | |||
| 156 | // accomodated by the standard adaptor class. | 156 | // accomodated by the standard adaptor class. |
| 157 | std::vector<Event> event_queue; | 157 | std::vector<Event> event_queue; |
| 158 | u64 event_fifo_id = 0; | 158 | u64 event_fifo_id = 0; |
| 159 | std::atomic<size_t> pending_events{}; | ||
| 160 | 159 | ||
| 161 | std::shared_ptr<EventType> ev_lost; | 160 | std::shared_ptr<EventType> ev_lost; |
| 161 | Common::Event event{}; | ||
| 162 | Common::Event pause_event{}; | ||
| 163 | std::mutex basic_lock; | ||
| 164 | std::mutex advance_lock; | ||
| 165 | std::unique_ptr<std::thread> timer_thread; | ||
| 166 | std::atomic<bool> paused{}; | ||
| 167 | std::atomic<bool> paused_set{}; | ||
| 168 | std::atomic<bool> wait_set{}; | ||
| 169 | std::atomic<bool> shutting_down{}; | ||
| 162 | std::atomic<bool> has_started{}; | 170 | std::atomic<bool> has_started{}; |
| 163 | std::function<void()> on_thread_init{}; | 171 | std::function<void()> on_thread_init{}; |
| 164 | 172 | ||
| 165 | std::vector<std::thread> worker_threads; | ||
| 166 | |||
| 167 | std::condition_variable event_cv; | ||
| 168 | std::condition_variable wait_pause_cv; | ||
| 169 | std::condition_variable wait_signal_cv; | ||
| 170 | mutable std::mutex event_mutex; | ||
| 171 | |||
| 172 | std::atomic<bool> paused_state{}; | ||
| 173 | bool is_paused{}; | ||
| 174 | bool shutting_down{}; | ||
| 175 | bool is_multicore{}; | 173 | bool is_multicore{}; |
| 176 | size_t pause_count{}; | ||
| 177 | s64 pause_end_time{}; | 174 | s64 pause_end_time{}; |
| 178 | 175 | ||
| 179 | /// Cycle timing | 176 | /// Cycle timing |