diff options
| author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2021-11-28 13:47:40 +0100 |
|---|---|---|
| committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2022-06-28 01:10:55 +0200 |
| commit | 0043292951306fa7f92f1d0ea0b59716859125d4 (patch) | |
| tree | 8079072946451c23e2a664f990234e6c76512297 /src/core/core_timing.cpp | |
| parent | d3becee4c0baa6034c8a211ea912296f0c8c0c85 (diff) | |
Core: Protect each event from race conditions within it.
Diffstat (limited to 'src/core/core_timing.cpp')
| -rw-r--r-- | src/core/core_timing.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index b6c295ada6..18dfa07f51 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)}); } |
