diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/core_timing.cpp | 2 | ||||
| -rw-r--r-- | src/core/core_timing.h | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index e671b270f..d6b5abc68 100644 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp | |||
| @@ -76,6 +76,7 @@ void CoreTiming::Initialize(std::function<void()>&& on_thread_init_) { | |||
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | void CoreTiming::ClearPendingEvents() { | 78 | void CoreTiming::ClearPendingEvents() { |
| 79 | std::scoped_lock lock{basic_lock}; | ||
| 79 | event_queue.clear(); | 80 | event_queue.clear(); |
| 80 | } | 81 | } |
| 81 | 82 | ||
| @@ -113,6 +114,7 @@ bool CoreTiming::IsRunning() const { | |||
| 113 | } | 114 | } |
| 114 | 115 | ||
| 115 | bool CoreTiming::HasPendingEvents() const { | 116 | bool CoreTiming::HasPendingEvents() const { |
| 117 | std::scoped_lock lock{basic_lock}; | ||
| 116 | return !(wait_set && event_queue.empty()); | 118 | return !(wait_set && event_queue.empty()); |
| 117 | } | 119 | } |
| 118 | 120 | ||
diff --git a/src/core/core_timing.h b/src/core/core_timing.h index 26a8b93a7..21548f0a9 100644 --- a/src/core/core_timing.h +++ b/src/core/core_timing.h | |||
| @@ -161,7 +161,7 @@ private: | |||
| 161 | std::shared_ptr<EventType> ev_lost; | 161 | std::shared_ptr<EventType> ev_lost; |
| 162 | Common::Event event{}; | 162 | Common::Event event{}; |
| 163 | Common::Event pause_event{}; | 163 | Common::Event pause_event{}; |
| 164 | std::mutex basic_lock; | 164 | mutable std::mutex basic_lock; |
| 165 | std::mutex advance_lock; | 165 | std::mutex advance_lock; |
| 166 | std::unique_ptr<std::jthread> timer_thread; | 166 | std::unique_ptr<std::jthread> timer_thread; |
| 167 | std::atomic<bool> paused{}; | 167 | std::atomic<bool> paused{}; |