summaryrefslogtreecommitdiff
path: root/src/core/core_timing.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/core_timing.h')
-rw-r--r--src/core/core_timing.h16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/core/core_timing.h b/src/core/core_timing.h
index 21548f0a9..d86337cdc 100644
--- a/src/core/core_timing.h
+++ b/src/core/core_timing.h
@@ -22,7 +22,7 @@ namespace Core::Timing {
22 22
23/// A callback that may be scheduled for a particular core timing event. 23/// A callback that may be scheduled for a particular core timing event.
24using TimedCallback = std::function<std::optional<std::chrono::nanoseconds>( 24using TimedCallback = std::function<std::optional<std::chrono::nanoseconds>(
25 std::uintptr_t user_data, s64 time, std::chrono::nanoseconds ns_late)>; 25 s64 time, std::chrono::nanoseconds ns_late)>;
26 26
27/// Contains the characteristics of a particular event. 27/// Contains the characteristics of a particular event.
28struct EventType { 28struct EventType {
@@ -89,22 +89,19 @@ public:
89 89
90 /// Schedules an event in core timing 90 /// Schedules an event in core timing
91 void ScheduleEvent(std::chrono::nanoseconds ns_into_future, 91 void ScheduleEvent(std::chrono::nanoseconds ns_into_future,
92 const std::shared_ptr<EventType>& event_type, std::uintptr_t user_data = 0, 92 const std::shared_ptr<EventType>& event_type, bool absolute_time = false);
93 bool absolute_time = false);
94 93
95 /// Schedules an event which will automatically re-schedule itself with the given time, until 94 /// Schedules an event which will automatically re-schedule itself with the given time, until
96 /// unscheduled 95 /// unscheduled
97 void ScheduleLoopingEvent(std::chrono::nanoseconds start_time, 96 void ScheduleLoopingEvent(std::chrono::nanoseconds start_time,
98 std::chrono::nanoseconds resched_time, 97 std::chrono::nanoseconds resched_time,
99 const std::shared_ptr<EventType>& event_type, 98 const std::shared_ptr<EventType>& event_type,
100 std::uintptr_t user_data = 0, bool absolute_time = false); 99 bool absolute_time = false);
101 100
102 void UnscheduleEvent(const std::shared_ptr<EventType>& event_type, std::uintptr_t user_data, 101 void UnscheduleEvent(const std::shared_ptr<EventType>& event_type, bool wait = true);
103 bool wait = true);
104 102
105 void UnscheduleEventWithoutWait(const std::shared_ptr<EventType>& event_type, 103 void UnscheduleEventWithoutWait(const std::shared_ptr<EventType>& event_type) {
106 std::uintptr_t user_data) { 104 UnscheduleEvent(event_type, false);
107 UnscheduleEvent(event_type, user_data, false);
108 } 105 }
109 106
110 void AddTicks(u64 ticks_to_add); 107 void AddTicks(u64 ticks_to_add);
@@ -158,7 +155,6 @@ private:
158 heap_t event_queue; 155 heap_t event_queue;
159 u64 event_fifo_id = 0; 156 u64 event_fifo_id = 0;
160 157
161 std::shared_ptr<EventType> ev_lost;
162 Common::Event event{}; 158 Common::Event event{};
163 Common::Event pause_event{}; 159 Common::Event pause_event{};
164 mutable std::mutex basic_lock; 160 mutable std::mutex basic_lock;