Commit graph

7 commits

Author SHA1 Message Date
Mihai Brodschi
bad78cfed4 Core, VideoCommon: Fix crash at shutdown due to destructor ordering
Previously, PerformanceTracker registered a callback to be updated on
emulation state changes. PerformanceTrackers live in a global variable
(g_perf_metrics) within libvideocommon. The callback was stored in a
global variable in libcore. This created a race condition at shutdown
between these libraries, when the PerfTracker's destructor tried to
unregister the callback.
Notify the PerfTracker directly from libcore, without callbacks, since
Core.cpp already references g_perf_metrics explicitly. Also rename
Core::CallOnStateChangedCallbacks to NotifyStateChanged to better
reflect what it's doing.
2025-04-28 07:11:53 +03:00
Jordan Woyak
46e0952e97 PerformanceTracker: Use SPSCQueue and atomic to eliminate need for a mutex. Clean up some math. 2025-03-15 14:40:00 -05:00
Jordan Woyak
c763961112 PerformanceTracker: Use std::deque instead of hand-rolled circular
queue.
2025-03-15 14:40:00 -05:00
Jordan Woyak
b2ce3fbefc PerformanceTracker: Pass chrono values instead of us s64. 2025-03-15 14:40:00 -05:00
Sam Belliveau
588a72a4fc
PerformanceTracker: Add ownership of m_log_name. 2023-01-06 20:27:25 +01:00
Sam Belliveau
bc46089ab0
PerformanceTracker: Use shared_mutex instead of mutex so multiple threads can read at the same time. 2023-01-06 20:27:25 +01:00
Sam Belliveau
673f81c18a New FrameTime/VBlank Analyzer + Graph 2022-12-23 19:52:53 -05:00