summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2021-11-28 13:47:40 +0100
committerFernando Sahmkow <fsahmkow27@gmail.com>2022-06-28 01:10:55 +0200
commit38e4a144a1e6f399482eb586c1e0d5646fae9679 (patch)
tree8079072946451c23e2a664f990234e6c76512297 /src
parentCore: Fix tests. (diff)
downloadyuzu-38e4a144a1e6f399482eb586c1e0d5646fae9679.tar
yuzu-38e4a144a1e6f399482eb586c1e0d5646fae9679.tar.gz
yuzu-38e4a144a1e6f399482eb586c1e0d5646fae9679.tar.bz2
yuzu-38e4a144a1e6f399482eb586c1e0d5646fae9679.tar.lz
yuzu-38e4a144a1e6f399482eb586c1e0d5646fae9679.tar.xz
yuzu-38e4a144a1e6f399482eb586c1e0d5646fae9679.tar.zst
yuzu-38e4a144a1e6f399482eb586c1e0d5646fae9679.zip
Diffstat (limited to 'src')
-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() {
event_mutex.unlock();
if (const auto event_type{evt.type.lock()}) {
+ std::unique_lock<std::mutex> lk(event_type->guard);
event_type->callback(evt.user_data, std::chrono::nanoseconds{static_cast<s64>(
GetGlobalTimeNs().count() - evt.time)});
}
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 {
TimedCallback callback;
/// A pointer to the name of the event.
const std::string name;
+ mutable std::mutex guard;
};
/**