From 08373314fc9ecd8beddd194186938261c7e72b54 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 11 Jul 2023 14:17:54 +0800 Subject: [PATCH] fix: https://github.com/bombela/backward-cpp/issues/303 --- backward.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backward.hpp b/backward.hpp index 670aa45..f42124e 100644 --- a/backward.hpp +++ b/backward.hpp @@ -330,10 +330,10 @@ #endif #endif // defined(BACKWARD_SYSTEM_DARWIN) +#include #if defined(BACKWARD_SYSTEM_WINDOWS) #include -#include #include #include @@ -4287,12 +4287,14 @@ class SignalHandling { private: details::handle _stack_content; bool _loaded; + static std::recursive_mutex _mu; #ifdef __GNUC__ __attribute__((noreturn)) #endif static void sig_handler(int signo, siginfo_t *info, void *_ctx) { + std::lock_guard lk(_mu); handleSignal(signo, info, _ctx); // try to forward the signal.