Showing the changes to interface/src/Application.cpp (1 of 73 files). Show all
Unified · Split
| @@ -411,6 +411,10 @@ public: · 410 unmodified lines | ||
| 411 | 411 | }); |
| 412 | 412 | } |
| 413 | 413 | |
| 414 | + void setMainThreadID(Qt::HANDLE threadID) { | |
| 415 | + _mainThreadID = threadID; | |
| 416 | + } | |
| 417 | + | |
| 414 | 418 | static void updateHeartbeat() { |
| 415 | 419 | auto now = usecTimestampNow(); |
| 416 | 420 | auto elapsed = now - _heartbeat; |
| @@ -418,7 +422,9 @@ public: · 1 unmodified line | ||
| 418 | 422 | _heartbeat = now; |
| 419 | 423 | } |
| 420 | 424 | |
| 421 | − static void deadlockDetectionCrash() { | |
| 425 | + void deadlockDetectionCrash() { | |
| 426 | + setCrashAnnotation("_mod_faulting_tid", std::to_string((uint64_t)_mainThreadID)); | |
| 427 | + setCrashAnnotation("deadlock", "1"); | |
| 422 | 428 | uint32_t* crashTrigger = nullptr; |
| 423 | 429 | *crashTrigger = 0xDEAD10CC; |
| 424 | 430 | } |
| @@ -505,6 +511,8 @@ public: · 80 unmodified lines | ||
| 505 | 511 | static ThreadSafeMovingAverage<int, HEARTBEAT_SAMPLES> _movingAverage; |
| 506 | 512 | |
| 507 | 513 | bool _quit { false }; |
| 514 | + | |
| 515 | + Qt::HANDLE _mainThreadID = nullptr; | |
| 508 | 516 | }; |
| 509 | 517 | |
| 510 | 518 | std::atomic<bool> DeadlockWatchdogThread::_paused; |
| @@ -977,7 +985,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 466 unmodified lines | ||
| 977 | 985 | _window(new MainWindow(desktop())), |
| 978 | 986 | _sessionRunTimer(startupTimer), |
| 979 | 987 | _previousSessionCrashed(setupEssentials(argc, argv, runningMarkerExisted)), |
| 980 | − _undoStackScriptingInterface(&_undoStack), | |
| 981 | 988 | _entitySimulation(new PhysicalEntitySimulation()), |
| 982 | 989 | _physicsEngine(new PhysicsEngine(Vectors::ZERO)), |
| 983 | 990 | _entityClipboard(new EntityTree()), |
| @@ -1055,6 +1062,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 71 unmodified lines | ||
| 1055 | 1062 | |
| 1056 | 1063 | auto controllerScriptingInterface = DependencyManager::get<controller::ScriptingInterface>().data(); |
| 1057 | 1064 | _controllerScriptingInterface = dynamic_cast<ControllerScriptingInterface*>(controllerScriptingInterface); |
| 1065 | + connect(PluginManager::getInstance().data(), &PluginManager::inputDeviceRunningChanged, | |
| 1066 | + controllerScriptingInterface, &controller::ScriptingInterface::updateRunningInputDevices); | |
| 1058 | 1067 | |
| 1059 | 1068 | _entityClipboard->createRootElement(); |
| 1060 | 1069 | |
| @@ -1094,7 +1103,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 33 unmodified lines | ||
| 1094 | 1103 | } |
| 1095 | 1104 | // Set up a watchdog thread to intentionally crash the application on deadlocks |
| 1096 | 1105 | if (!DISABLE_WATCHDOG) { |
| 1097 | − (new DeadlockWatchdogThread())->start(); | |
| 1106 | + auto deadlockWatchdogThread = new DeadlockWatchdogThread(); | |
| 1107 | + deadlockWatchdogThread->setMainThreadID(QThread::currentThreadId()); | |
| 1108 | + deadlockWatchdogThread->start(); | |
| 1098 | 1109 | } |
| 1099 | 1110 | |
| 1100 | 1111 | // Set File Logger Session UUID |
| @@ -3101,7 +3112,6 @@ void Application::onDesktopRootContextCreated(QQmlContext* surfaceContext) { · 2000 unmodified lines | ||
| 3101 | 3112 | surfaceContext->setContextProperty("DialogsManager", _dialogsManagerScriptingInterface); |
| 3102 | 3113 | surfaceContext->setContextProperty("FaceTracker", DependencyManager::get<DdeFaceTracker>().data()); |
| 3103 | 3114 | surfaceContext->setContextProperty("AvatarManager", DependencyManager::get<AvatarManager>().data()); |
| 3104 | − surfaceContext->setContextProperty("UndoStack", &_undoStackScriptingInterface); | |
| 3105 | 3115 | surfaceContext->setContextProperty("LODManager", DependencyManager::get<LODManager>().data()); |
| 3106 | 3116 | surfaceContext->setContextProperty("HMD", DependencyManager::get<HMDScriptingInterface>().data()); |
| 3107 | 3117 | surfaceContext->setContextProperty("Scene", DependencyManager::get<SceneScriptingInterface>().data()); |
| @@ -6773,8 +6783,6 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEnginePointe · 3665 unmodified lines | ||
| 6773 | 6783 | |
| 6774 | 6784 | scriptEngine->registerGlobalObject("AvatarManager", DependencyManager::get<AvatarManager>().data()); |
| 6775 | 6785 | |
| 6776 | − scriptEngine->registerGlobalObject("UndoStack", &_undoStackScriptingInterface); | |
| 6777 | − | |
| 6778 | 6786 | scriptEngine->registerGlobalObject("LODManager", DependencyManager::get<LODManager>().data()); |
| 6779 | 6787 | |
| 6780 | 6788 | scriptEngine->registerGlobalObject("Paths", DependencyManager::get<PathUtils>().data()); |