diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 85172fc73f..fcae7430a8 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -289,6 +289,10 @@ static QTimer locationUpdateTimer; static QTimer identityPacketTimer; static QTimer pingTimer; +static const QString DISABLE_WATCHDOG_FLAG("HIFI_DISABLE_WATCHDOG"); +static bool DISABLE_WATCHDOG = QProcessEnvironment::systemEnvironment().contains(DISABLE_WATCHDOG_FLAG); + + static const int MAX_CONCURRENT_RESOURCE_DOWNLOADS = 16; // For processing on QThreadPool, we target a number of threads after reserving some @@ -805,8 +809,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo nodeList->startThread(); // Set up a watchdog thread to intentionally crash the application on deadlocks - _deadlockWatchdogThread = new DeadlockWatchdogThread(); - _deadlockWatchdogThread->start(); + if (!DISABLE_WATCHDOG) { + (new DeadlockWatchdogThread())->start(); + } if (steamClient) { qCDebug(interfaceapp) << "[VERSION] SteamVR buildID:" << steamClient->getSteamVRBuildID(); @@ -1933,7 +1938,7 @@ void Application::showCursor(const Cursor::Icon& cursor) { } void Application::updateHeartbeat() const { - static_cast(_deadlockWatchdogThread)->updateHeartbeat(); + DeadlockWatchdogThread::updateHeartbeat(); } void Application::onAboutToQuit() { diff --git a/interface/src/Application.h b/interface/src/Application.h index 74e84ae92c..0819555584 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -650,8 +650,6 @@ private: Qt::CursorShape _desiredCursor{ Qt::BlankCursor }; bool _cursorNeedsChanging { false }; - QThread* _deadlockWatchdogThread; - std::map> _postUpdateLambdas; std::mutex _postUpdateLambdasLock;