mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 18:26:26 +02:00
Better deadlock crash
This commit is contained in:
parent
7c9464572a
commit
3c4e543b3c
1 changed files with 12 additions and 2 deletions
|
@ -410,6 +410,10 @@ public:
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setMainThreadID(Qt::HANDLE threadID) {
|
||||||
|
_mainThreadID = threadID;
|
||||||
|
}
|
||||||
|
|
||||||
static void updateHeartbeat() {
|
static void updateHeartbeat() {
|
||||||
auto now = usecTimestampNow();
|
auto now = usecTimestampNow();
|
||||||
auto elapsed = now - _heartbeat;
|
auto elapsed = now - _heartbeat;
|
||||||
|
@ -417,7 +421,9 @@ public:
|
||||||
_heartbeat = now;
|
_heartbeat = now;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deadlockDetectionCrash() {
|
void deadlockDetectionCrash() {
|
||||||
|
setCrashAnnotation("_mod_faulting_tid", std::to_string((uint64_t)_mainThreadID));
|
||||||
|
setCrashAnnotation("deadlock", "1");
|
||||||
uint32_t* crashTrigger = nullptr;
|
uint32_t* crashTrigger = nullptr;
|
||||||
*crashTrigger = 0xDEAD10CC;
|
*crashTrigger = 0xDEAD10CC;
|
||||||
}
|
}
|
||||||
|
@ -504,6 +510,8 @@ public:
|
||||||
static ThreadSafeMovingAverage<int, HEARTBEAT_SAMPLES> _movingAverage;
|
static ThreadSafeMovingAverage<int, HEARTBEAT_SAMPLES> _movingAverage;
|
||||||
|
|
||||||
bool _quit { false };
|
bool _quit { false };
|
||||||
|
|
||||||
|
Qt::HANDLE _mainThreadID = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::atomic<bool> DeadlockWatchdogThread::_paused;
|
std::atomic<bool> DeadlockWatchdogThread::_paused;
|
||||||
|
@ -1092,7 +1100,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
}
|
}
|
||||||
// Set up a watchdog thread to intentionally crash the application on deadlocks
|
// Set up a watchdog thread to intentionally crash the application on deadlocks
|
||||||
if (!DISABLE_WATCHDOG) {
|
if (!DISABLE_WATCHDOG) {
|
||||||
(new DeadlockWatchdogThread())->start();
|
auto deadlockWatchdogThread = new DeadlockWatchdogThread();
|
||||||
|
deadlockWatchdogThread->setMainThreadID(QThread::currentThreadId());
|
||||||
|
deadlockWatchdogThread->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set File Logger Session UUID
|
// Set File Logger Session UUID
|
||||||
|
|
Loading…
Reference in a new issue