diff --git a/Core/Debugger.cpp b/Core/Debugger.cpp index c900e2b4..d8cf9171 100644 --- a/Core/Debugger.cpp +++ b/Core/Debugger.cpp @@ -574,8 +574,7 @@ bool Debugger::SleepUntilResume() if(stepCount == 0 && !_stopFlag && _suspendCount == 0) { //Break auto lock = _breakLock.AcquireSafe(); - _executionStopped = true; - + if(_preventResume == 0) { SoundMixer::StopAudio(); MessageManager::SendNotification(ConsoleNotificationType::CodeBreak); @@ -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(10)); stepCount = _stepCount.load(); diff --git a/Utilities/SimpleLock.cpp b/Utilities/SimpleLock.cpp index 5129986a..b3f6946e 100644 --- a/Utilities/SimpleLock.cpp +++ b/Utilities/SimpleLock.cpp @@ -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()