mirror of
https://github.com/libretro/MesenCE.git
synced 2026-11-10 11:11:32 -10:00
* Code: Add auto-formatting rules for C++ projects (clang-format) and enforce code style via "clang-format" and "dotnet format" * fix ui format warnings
36 lines
717 B
C++
36 lines
717 B
C++
#include "pch.h"
|
|
#include "Shared/EmulatorLock.h"
|
|
#include "Shared/Emulator.h"
|
|
#include "Shared/DebuggerRequest.h"
|
|
#include "Debugger/DebugBreakHelper.h"
|
|
|
|
EmulatorLock::EmulatorLock(Emulator* emu, bool allowDebuggerLock)
|
|
{
|
|
_emu = emu;
|
|
|
|
if(_emu->_runLock.IsLockedByCurrentThread()) {
|
|
_emu->Lock();
|
|
} else {
|
|
if(allowDebuggerLock) {
|
|
_debugger.reset(new DebuggerRequest(emu->GetDebugger(false)));
|
|
if(_debugger->GetDebugger()) {
|
|
_breakHelper.reset(new DebugBreakHelper(_debugger->GetDebugger(), true));
|
|
} else {
|
|
_debugger.reset();
|
|
_emu->Lock();
|
|
}
|
|
} else {
|
|
_emu->Lock();
|
|
}
|
|
}
|
|
}
|
|
|
|
EmulatorLock::~EmulatorLock()
|
|
{
|
|
if(_debugger) {
|
|
_breakHelper.reset();
|
|
} else {
|
|
_emu->Unlock();
|
|
}
|
|
}
|