diff --git a/src/symbols/symbols_with_dbghelp.cpp b/src/symbols/symbols_with_dbghelp.cpp index c8e8361..d98fb37 100644 --- a/src/symbols/symbols_with_dbghelp.cpp +++ b/src/symbols/symbols_with_dbghelp.cpp @@ -321,11 +321,11 @@ namespace dbghelp { return true; } - std::mutex dbghelp_lock; + std::recursive_mutex dbghelp_lock; // TODO: Handle backtrace_pcinfo calling the callback multiple times on inlined functions stacktrace_frame resolve_frame(HANDLE proc, uintptr_t addr) { - const std::lock_guard lock(dbghelp_lock); // all dbghelp functions are not thread safe + const std::lock_guard lock(dbghelp_lock); // all dbghelp functions are not thread safe alignas(SYMBOL_INFO) char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME * sizeof(TCHAR)]; SYMBOL_INFO* symbol = (SYMBOL_INFO*)buffer; symbol->SizeOfStruct = sizeof(SYMBOL_INFO); @@ -402,6 +402,7 @@ namespace dbghelp { } std::vector resolve_frames(const std::vector& frames) { + const std::lock_guard lock(dbghelp_lock); // all dbghelp functions are not thread safe std::vector trace; trace.reserve(frames.size());