History

Merge branch 'master' into stt_parenting2

sabrina-shanman committed 8 years ago

Commit 2ef85df2 parents 67dc526 4805d3573 files · +3173 −1221Browse files

Showing the changes to interface/src/Application.cpp (1 of 73 files). Show all

Unified · Split

interface/src/Application.cpp+14−6
@@ -411,6 +411,10 @@ public: · 410 unmodified lines
411411 });
412412 }
413413
414+ void setMainThreadID(Qt::HANDLE threadID) {
415+ _mainThreadID = threadID;
416+ }
417+
414418 static void updateHeartbeat() {
415419 auto now = usecTimestampNow();
416420 auto elapsed = now - _heartbeat;
@@ -418,7 +422,9 @@ public: · 1 unmodified line
418422 _heartbeat = now;
419423 }
420424
421− static void deadlockDetectionCrash() {
425+ void deadlockDetectionCrash() {
426+ setCrashAnnotation("_mod_faulting_tid", std::to_string((uint64_t)_mainThreadID));
427+ setCrashAnnotation("deadlock", "1");
422428 uint32_t* crashTrigger = nullptr;
423429 *crashTrigger = 0xDEAD10CC;
424430 }
@@ -505,6 +511,8 @@ public: · 80 unmodified lines
505511 static ThreadSafeMovingAverage<int, HEARTBEAT_SAMPLES> _movingAverage;
506512
507513 bool _quit { false };
514+
515+ Qt::HANDLE _mainThreadID = nullptr;
508516 };
509517
510518 std::atomic<bool> DeadlockWatchdogThread::_paused;
@@ -977,7 +985,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 466 unmodified lines
977985 _window(new MainWindow(desktop())),
978986 _sessionRunTimer(startupTimer),
979987 _previousSessionCrashed(setupEssentials(argc, argv, runningMarkerExisted)),
980− _undoStackScriptingInterface(&_undoStack),
981988 _entitySimulation(new PhysicalEntitySimulation()),
982989 _physicsEngine(new PhysicsEngine(Vectors::ZERO)),
983990 _entityClipboard(new EntityTree()),
@@ -1055,6 +1062,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 71 unmodified lines
10551062
10561063 auto controllerScriptingInterface = DependencyManager::get<controller::ScriptingInterface>().data();
10571064 _controllerScriptingInterface = dynamic_cast<ControllerScriptingInterface*>(controllerScriptingInterface);
1065+ connect(PluginManager::getInstance().data(), &PluginManager::inputDeviceRunningChanged,
1066+ controllerScriptingInterface, &controller::ScriptingInterface::updateRunningInputDevices);
10581067
10591068 _entityClipboard->createRootElement();
10601069
@@ -1094,7 +1103,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 33 unmodified lines
10941103 }
10951104 // Set up a watchdog thread to intentionally crash the application on deadlocks
10961105 if (!DISABLE_WATCHDOG) {
1097− (new DeadlockWatchdogThread())->start();
1106+ auto deadlockWatchdogThread = new DeadlockWatchdogThread();
1107+ deadlockWatchdogThread->setMainThreadID(QThread::currentThreadId());
1108+ deadlockWatchdogThread->start();
10981109 }
10991110
11001111 // Set File Logger Session UUID
@@ -3101,7 +3112,6 @@ void Application::onDesktopRootContextCreated(QQmlContext* surfaceContext) { · 2000 unmodified lines
31013112 surfaceContext->setContextProperty("DialogsManager", _dialogsManagerScriptingInterface);
31023113 surfaceContext->setContextProperty("FaceTracker", DependencyManager::get<DdeFaceTracker>().data());
31033114 surfaceContext->setContextProperty("AvatarManager", DependencyManager::get<AvatarManager>().data());
3104− surfaceContext->setContextProperty("UndoStack", &_undoStackScriptingInterface);
31053115 surfaceContext->setContextProperty("LODManager", DependencyManager::get<LODManager>().data());
31063116 surfaceContext->setContextProperty("HMD", DependencyManager::get<HMDScriptingInterface>().data());
31073117 surfaceContext->setContextProperty("Scene", DependencyManager::get<SceneScriptingInterface>().data());
@@ -6773,8 +6783,6 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEnginePointe · 3665 unmodified lines
67736783
67746784 scriptEngine->registerGlobalObject("AvatarManager", DependencyManager::get<AvatarManager>().data());
67756785
6776− scriptEngine->registerGlobalObject("UndoStack", &_undoStackScriptingInterface);
6777−
67786786 scriptEngine->registerGlobalObject("LODManager", DependencyManager::get<LODManager>().data());
67796787
67806788 scriptEngine->registerGlobalObject("Paths", DependencyManager::get<PathUtils>().data());