summaryrefslogtreecommitdiff
path: root/src/core/core_timing.h
diff options
context:
space:
mode:
authorGravatar Liam2023-12-23 14:20:10 -0500
committerGravatar Liam2023-12-23 15:36:46 -0500
commit05eda56e668f3a04c1f2600cd1a887ecd6ee1961 (patch)
treeff2ff27b5fe665c2b7f3cd6ee06baa70139f7d32 /src/core/core_timing.h
parentcore_timing: use static typing for no-wait unschedule (diff)
downloadyuzu-05eda56e668f3a04c1f2600cd1a887ecd6ee1961.tar.gz
yuzu-05eda56e668f3a04c1f2600cd1a887ecd6ee1961.tar.xz
yuzu-05eda56e668f3a04c1f2600cd1a887ecd6ee1961.zip
core_timing: handle concurrent unscheduling of looping events
Diffstat (limited to 'src/core/core_timing.h')
-rw-r--r--src/core/core_timing.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/core_timing.h b/src/core/core_timing.h
index d8cd599ee..7e4dff7f3 100644
--- a/src/core/core_timing.h
+++ b/src/core/core_timing.h
@@ -27,12 +27,15 @@ using TimedCallback = std::function<std::optional<std::chrono::nanoseconds>(
27/// Contains the characteristics of a particular event. 27/// Contains the characteristics of a particular event.
28struct EventType { 28struct EventType {
29 explicit EventType(TimedCallback&& callback_, std::string&& name_) 29 explicit EventType(TimedCallback&& callback_, std::string&& name_)
30 : callback{std::move(callback_)}, name{std::move(name_)} {} 30 : callback{std::move(callback_)}, name{std::move(name_)}, sequence_number{0} {}
31 31
32 /// The event's callback function. 32 /// The event's callback function.
33 TimedCallback callback; 33 TimedCallback callback;
34 /// A pointer to the name of the event. 34 /// A pointer to the name of the event.
35 const std::string name; 35 const std::string name;
36 /// A monotonic sequence number, incremented when this event is
37 /// changed externally.
38 size_t sequence_number;
36}; 39};
37 40
38enum class UnscheduleEventType { 41enum class UnscheduleEventType {