mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 21:00:17 +02:00
Every time I see this recursive mutex I glare at it. Remove the last one so that we no longer need to deal with it. The only reason why this recursive mutex still existed today was because it is fairly intertwined with the ContextImpl and tracing it all was a pain. Peel back the layers and follow the idiom to have ContextImpl pull the write mutex when requiredand pass it through by reference to ensure it stays alive. This allows us to entirely give rid of the recursive nature of the mutex, which means that `FindBlock` can eventually be switched over to a read-lock to improve multiple threads reading the caches at the same time. I didn't do that exercise since that can be followed up in a subsequent PR.