mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 15:49:24 +02:00
Merge pull request #15539 from jherico/fix/watchdog_spam
BUGZ-131: Reduce spam from watchdog thread
This commit is contained in:
commit
5c9570cffb
1 changed files with 13 additions and 3 deletions
|
@ -331,6 +331,7 @@ static const unsigned int THROTTLED_SIM_FRAMERATE = 15;
|
||||||
static const int THROTTLED_SIM_FRAME_PERIOD_MS = MSECS_PER_SECOND / THROTTLED_SIM_FRAMERATE;
|
static const int THROTTLED_SIM_FRAME_PERIOD_MS = MSECS_PER_SECOND / THROTTLED_SIM_FRAMERATE;
|
||||||
static const int ENTITY_SERVER_ADDED_TIMEOUT = 5000;
|
static const int ENTITY_SERVER_ADDED_TIMEOUT = 5000;
|
||||||
static const int ENTITY_SERVER_CONNECTION_TIMEOUT = 5000;
|
static const int ENTITY_SERVER_CONNECTION_TIMEOUT = 5000;
|
||||||
|
static const int WATCHDOG_TIMER_TIMEOUT = 100;
|
||||||
|
|
||||||
static const float INITIAL_QUERY_RADIUS = 10.0f; // priority radius for entities before physics enabled
|
static const float INITIAL_QUERY_RADIUS = 10.0f; // priority radius for entities before physics enabled
|
||||||
|
|
||||||
|
@ -1138,6 +1139,18 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
auto deadlockWatchdogThread = new DeadlockWatchdogThread();
|
auto deadlockWatchdogThread = new DeadlockWatchdogThread();
|
||||||
deadlockWatchdogThread->setMainThreadID(QThread::currentThreadId());
|
deadlockWatchdogThread->setMainThreadID(QThread::currentThreadId());
|
||||||
deadlockWatchdogThread->start();
|
deadlockWatchdogThread->start();
|
||||||
|
|
||||||
|
|
||||||
|
// Main thread timer to keep the watchdog updated
|
||||||
|
QTimer* watchdogUpdateTimer = new QTimer(this);
|
||||||
|
connect(watchdogUpdateTimer, &QTimer::timeout, [this] { updateHeartbeat(); });
|
||||||
|
connect(this, &QCoreApplication::aboutToQuit, [watchdogUpdateTimer] {
|
||||||
|
watchdogUpdateTimer->stop();
|
||||||
|
watchdogUpdateTimer->deleteLater();
|
||||||
|
});
|
||||||
|
watchdogUpdateTimer->setSingleShot(false);
|
||||||
|
watchdogUpdateTimer->setInterval(WATCHDOG_TIMER_TIMEOUT); // 100ms, Qt::CoarseTimer acceptable
|
||||||
|
watchdogUpdateTimer->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set File Logger Session UUID
|
// Set File Logger Session UUID
|
||||||
|
@ -4990,9 +5003,6 @@ void setupCpuMonitorThread() {
|
||||||
void Application::idle() {
|
void Application::idle() {
|
||||||
PerformanceTimer perfTimer("idle");
|
PerformanceTimer perfTimer("idle");
|
||||||
|
|
||||||
// Update the deadlock watchdog
|
|
||||||
updateHeartbeat();
|
|
||||||
|
|
||||||
#if !defined(DISABLE_QML)
|
#if !defined(DISABLE_QML)
|
||||||
auto offscreenUi = getOffscreenUI();
|
auto offscreenUi = getOffscreenUI();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue