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.