From 4daa51570018900f12ede73f8bf73f6964a381bc Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Fri, 29 Sep 2023 20:05:43 +0100 Subject: watchdog: don't hang on exit --- src/helpers/Watchdog.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/helpers/Watchdog.cpp') diff --git a/src/helpers/Watchdog.cpp b/src/helpers/Watchdog.cpp index f5d85df7..2a26ee29 100644 --- a/src/helpers/Watchdog.cpp +++ b/src/helpers/Watchdog.cpp @@ -3,6 +3,9 @@ #include "config/ConfigManager.hpp" CWatchdog::~CWatchdog() { + m_bExitThread = true; + m_bNotified = true; + m_cvWatchdogCondition.notify_all(); m_pWatchdog.reset(); } @@ -22,6 +25,9 @@ CWatchdog::CWatchdog() { pthread_kill(m_iMainThreadPID, SIGUSR1); } + if (m_bExitThread) + break; + m_bWatching = false; m_bNotified = false; } -- cgit v1.2.3