Commit Graph

6 Commits

Author SHA1 Message Date
Lioncash 16d8b6e6b3 Common/HookableEvent: std::move callback instance in Register()
Potentially avoids reallocations if the capture buffer of the callback
is quite large.
2024-01-31 13:16:50 -05:00
Pokechu22 9e0755a598 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).
2023-04-02 15:51:21 -07:00
Scott Mansell 901f12c935 HookableEvents: Add [[nodiscard]] to Register 2023-03-06 00:12:26 +13:00
Scott Mansell 05181f6b88 HookableEvent: Switch to construct on first use
A registration might happen during static initialization, which opens
us up to issues with ordering of static initialization.
2023-02-13 18:48:43 +13:00
Scott Mansell 59a4b026f6 Better documentation for HookableEvent. 2023-02-09 18:36:20 +13:00
Scott Mansell 8c8bd0e7ac Rename to HookableEvent. Because naming conflict 2023-02-09 18:36:20 +13:00