Merge pull request #11491 from jherico/dev/disable_watchdog

Disable watchdog with environment variable
This commit is contained in:
Sam Gateau 2017-10-02 10:19:32 -07:00 committed by GitHub
commit 68046ae4e3
2 changed files with 8 additions and 5 deletions

View file

@ -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*>(_deadlockWatchdogThread)->updateHeartbeat();
DeadlockWatchdogThread::updateHeartbeat();
}
void Application::onAboutToQuit() {

View file

@ -650,8 +650,6 @@ private:
Qt::CursorShape _desiredCursor{ Qt::BlankCursor };
bool _cursorNeedsChanging { false };
QThread* _deadlockWatchdogThread;
std::map<void*, std::function<void()>> _postUpdateLambdas;
std::mutex _postUpdateLambdasLock;