summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/core/core_timing.cpp1
-rw-r--r--src/core/core_timing.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp
index b6c295ada..18dfa07f5 100644
--- a/src/core/core_timing.cpp
+++ b/src/core/core_timing.cpp
@@ -226,6 +226,7 @@ std::optional<s64> CoreTiming::Advance() {
226 event_mutex.unlock(); 226 event_mutex.unlock();
227 227
228 if (const auto event_type{evt.type.lock()}) { 228 if (const auto event_type{evt.type.lock()}) {
229 std::unique_lock<std::mutex> lk(event_type->guard);
229 event_type->callback(evt.user_data, std::chrono::nanoseconds{static_cast<s64>( 230 event_type->callback(evt.user_data, std::chrono::nanoseconds{static_cast<s64>(
230 GetGlobalTimeNs().count() - evt.time)}); 231 GetGlobalTimeNs().count() - evt.time)});
231 } 232 }
diff --git a/src/core/core_timing.h b/src/core/core_timing.h
index 901bf532e..4fef6fcce 100644
--- a/src/core/core_timing.h
+++ b/src/core/core_timing.h
@@ -32,6 +32,7 @@ struct EventType {
32 TimedCallback callback; 32 TimedCallback callback;
33 /// A pointer to the name of the event. 33 /// A pointer to the name of the event.
34 const std::string name; 34 const std::string name;
35 mutable std::mutex guard;
35}; 36};
36 37
37/** 38/**