Debugger: Disabled pause when in debugger - fixes deadlocks

This commit is contained in:
Souryo 2016-12-14 20:48:47 -05:00
parent 33385e7996
commit 666dc14043
2 changed files with 10 additions and 1 deletions

View File

@ -325,11 +325,17 @@ void Console::Run()
_runLock.Release();
PlatformUtilities::EnableScreensaver();
while(paused && !_stop) {
while(paused && !_stop && _debugger == nullptr) {
//Sleep until emulation is resumed
std::this_thread::sleep_for(std::chrono::duration<int, std::milli>(100));
paused = EmulationSettings::IsPaused();
}
if(_debugger != nullptr) {
//Prevent pausing when debugger is active
EmulationSettings::ClearFlags(EmulationFlags::Paused);
}
PlatformUtilities::DisableScreensaver();
_runLock.Acquire();
MessageManager::SendNotification(ConsoleNotificationType::GameResumed);

View File

@ -562,6 +562,9 @@ namespace Mesen.GUI.Forms
mnuSaveState.Enabled = (_emuThread != null && !isNetPlayClient && !InteropEmu.IsNsf());
mnuLoadState.Enabled = (_emuThread != null && !isNetPlayClient && !InteropEmu.IsNsf() && !InteropEmu.MoviePlaying() && !InteropEmu.MovieRecording());
//Disable pause when debugger is running
mnuPause.Enabled &= !InteropEmu.DebugIsDebuggerRunning();
mnuPause.Text = InteropEmu.IsPaused() ? ResourceHelper.GetMessage("Resume") : ResourceHelper.GetMessage("Pause");
mnuPause.Image = InteropEmu.IsPaused() ? Mesen.GUI.Properties.Resources.Play : Mesen.GUI.Properties.Resources.Pause;