summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2020-02-12 18:16:16 +0100
committerLuboš Luňák <l.lunak@collabora.com>2020-02-13 18:21:55 +0100
commite0a94e9625109d5bda085dec8b8226bc5b631bab (patch)
treea268381a1939e838729ce03e4eedda098f341586
parenta2e0abc7c6b02e2ea37d269e216d6550be76c8fe (diff)
improve debugger/valgrind handling in watchdog
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 <l.lunak@collabora.com>
-rw-r--r--vcl/source/app/watchdog.cxx17
1 files 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<OpenGLZone>::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();