Make sure not to break when GE debugger closed.

Also, try to fix a might-be race condition.
This commit is contained in:
Unknown W. Brackets 2014-05-15 22:45:51 -07:00
parent 2ad06d777b
commit fc7b5f3141
2 changed files with 6 additions and 4 deletions

View File

@ -31,7 +31,7 @@ enum PauseAction {
PAUSE_GETTEX,
PAUSE_SETCMDVALUE,
};
static bool isStepping;
static recursive_mutex pauseLock;
@ -40,7 +40,7 @@ static PauseAction pauseAction = PAUSE_CONTINUE;
static recursive_mutex actionLock;
static condition_variable actionWait;
// In case of accidental wakeup.
static bool actionComplete;
static volatile bool actionComplete;
// Many things need to run on the GPU thread. For example, reading the framebuffer.
// A message system is used to achieve this (temporarily "unpausing" the thread.)

View File

@ -271,8 +271,8 @@ void CGEDebugger::SetBreakNext(BreakNextType type) {
attached = true;
SetupPreviews();
ResumeFromStepping();
breakNext = type;
ResumeFromStepping();
}
BOOL CGEDebugger::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) {
@ -455,7 +455,9 @@ static void DeliverMessage(UINT msg, WPARAM wParam, LPARAM lParam) {
}
static void PauseWithMessage(UINT msg, WPARAM wParam = NULL, LPARAM lParam = NULL) {
EnterStepping(std::bind(&DeliverMessage, msg, wParam, lParam));
if (attached) {
EnterStepping(std::bind(&DeliverMessage, msg, wParam, lParam));
}
}
void WindowsHost::GPUNotifyCommand(u32 pc) {