Debugger: Fixed multi-threading issue that caused debugger to open up on its own while Lua scripts were running
This commit is contained in:
parent
ab91bef2b0
commit
eb8f01b7e9
2 changed files with 3 additions and 7 deletions
|
@ -574,7 +574,6 @@ bool Debugger::SleepUntilResume()
|
|||
if(stepCount == 0 && !_stopFlag && _suspendCount == 0) {
|
||||
//Break
|
||||
auto lock = _breakLock.AcquireSafe();
|
||||
_executionStopped = true;
|
||||
|
||||
if(_preventResume == 0) {
|
||||
SoundMixer::StopAudio();
|
||||
|
@ -586,6 +585,7 @@ bool Debugger::SleepUntilResume()
|
|||
}
|
||||
}
|
||||
|
||||
_executionStopped = true;
|
||||
while((stepCount == 0 && !_stopFlag && _suspendCount == 0) || _preventResume > 0) {
|
||||
std::this_thread::sleep_for(std::chrono::duration<int, std::milli>(10));
|
||||
stepCount = _stepCount.load();
|
||||
|
|
|
@ -34,11 +34,7 @@ void SimpleLock::Acquire()
|
|||
|
||||
bool SimpleLock::IsFree()
|
||||
{
|
||||
if(!_lock.test_and_set()) {
|
||||
_lock.clear();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return _lockCount == 0;
|
||||
}
|
||||
|
||||
void SimpleLock::WaitForRelease()
|
||||
|
|
Loading…
Add table
Reference in a new issue