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