From e0a94e9625109d5bda085dec8b8226bc5b631bab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Wed, 12 Feb 2020 18:16:16 +0100 Subject: [PATCH] improve debugger/valgrind handling in watchdog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This way it'll avoid incorrect lock-up detection also if the debugger is attached later when LO is already running. Change-Id: I9b762ee439a62631036ad2f09f4396cca0b5ba6b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88609 Tested-by: Jenkins Reviewed-by: Luboš Luňák --- vcl/source/app/watchdog.cxx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/vcl/source/app/watchdog.cxx b/vcl/source/app/watchdog.cxx index bd8b28db89e6..c45e51c04194 100644 --- a/vcl/source/app/watchdog.cxx +++ b/vcl/source/app/watchdog.cxx @@ -114,6 +114,15 @@ void WatchdogThread::execute() gpWatchdogExit->wait(&aQuarterSecond); +#if defined HAVE_VALGRIND_HEADERS + if (RUNNING_ON_VALGRIND) + continue; +#endif +#if defined DBG_UTIL + if (comphelper::isDebuggerAttached()) + continue; +#endif + #if HAVE_FEATURE_OPENGL WatchdogHelper::check(); #endif @@ -130,14 +139,6 @@ void WatchdogThread::start() return; // already running if (getenv("SAL_DISABLE_WATCHDOG")) return; -#if defined HAVE_VALGRIND_HEADERS - if (RUNNING_ON_VALGRIND) - return; -#endif -#if defined DBG_UTIL - if (comphelper::isDebuggerAttached()) - return; -#endif gpWatchdogExit = new osl::Condition(); gxWatchdog.set(new WatchdogThread()); gxWatchdog->launch();