mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 00:59:44 -06:00
DolphinQt: Properly lock CPU before accessing emulated memory
This fixes a problem I was having where using frame advance with the debugger open would frequently cause panic alerts about invalid addresses due to the CPU thread changing MSR.DR while the host thread was trying to access memory. To aid in tracking down all the places where we weren't properly locking the CPU, I've created a new type (in Core.h) that you have to pass as a reference or pointer to functions that require running as the CPU thread.
This commit is contained in:
@ -16,6 +16,11 @@
|
||||
|
||||
class IniFile;
|
||||
|
||||
namespace Core
|
||||
{
|
||||
class CPUThreadGuard;
|
||||
}
|
||||
|
||||
namespace DiscIO
|
||||
{
|
||||
enum class Language;
|
||||
@ -68,7 +73,7 @@ struct SConfig
|
||||
void SetRunningGameMetadata(const std::string& game_id);
|
||||
// Reloads title-specific map files, patches, custom textures, etc.
|
||||
// This should only be called after the new title has been loaded into memory.
|
||||
static void OnNewTitleLoad();
|
||||
static void OnNewTitleLoad(const Core::CPUThreadGuard& guard);
|
||||
|
||||
void LoadDefaults();
|
||||
static std::string MakeGameID(std::string_view file_name);
|
||||
|
Reference in New Issue
Block a user