From 9e0755a5983d8d9a277cea284534fb32a545f270 Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Sun, 2 Apr 2023 15:51:06 -0700 Subject: [PATCH] HookableEvent: Use std::recursive_mutex instead of std::mutex This fixes a crash when recording fifologs, as the mutex is acquired when BPWritten calls AfterFrameEvent::Trigger, but then acquired again when FifoRecorder::EndFrame calls m_end_of_frame_event.reset(). std::mutex does not allow calling lock() if the thread already owns the mutex, while std::recursive_mutex does allow this. This is a regression from #11522 (which introduced the HookableEvent system). --- Source/Core/Common/HookableEvent.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Common/HookableEvent.h b/Source/Core/Common/HookableEvent.h index ea012bddf0..be97a8ab9b 100644 --- a/Source/Core/Common/HookableEvent.h +++ b/Source/Core/Common/HookableEvent.h @@ -69,7 +69,7 @@ private: struct Storage { - std::mutex m_mutex; + std::recursive_mutex m_mutex; std::vector m_listeners; };