diff --git a/lldb/tools/lldb-dap/Handler/RequestHandler.cpp b/lldb/tools/lldb-dap/Handler/RequestHandler.cpp index 3520dc2c71a55..be9273963654a 100644 --- a/lldb/tools/lldb-dap/Handler/RequestHandler.cpp +++ b/lldb/tools/lldb-dap/Handler/RequestHandler.cpp @@ -14,6 +14,7 @@ #include "Protocol/ProtocolBase.h" #include "RunInTerminal.h" #include "llvm/Support/Error.h" +#include #if !defined(_WIN32) #include @@ -180,6 +181,9 @@ void BaseRequestHandler::Run(const Request &request) { return; } + lldb::SBMutex lock = dap.GetAPIMutex(); + std::lock_guard guard(lock); + // FIXME: After all the requests have migrated from LegacyRequestHandler > // RequestHandler<> we should be able to move this into // RequestHandler<>::operator().