History

Merge branch 'stable' of https://github.com/highfidelity/hifi into merge-back

Atlante45 committed 8 years ago

Commit bc819c62 parents b379855 408189738 files · +497 −379Browse files

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

Unified · Split

interface/src/Application.cpp+27−4
@@ -149,6 +149,7 @@ · 148 unmodified lines
149149 #include "avatar/AvatarManager.h"
150150 #include "avatar/MyHead.h"
151151 #include "CrashHandler.h"
152+#include "Crashpad.h"
152153 #include "devices/DdeFaceTracker.h"
153154 #include "DiscoverabilityManager.h"
154155 #include "GLCanvas.h"
@@ -396,6 +397,7 @@ public: · 241 unmodified lines
396397 setObjectName("Deadlock Watchdog");
397398 // Give the heartbeat an initial value
398399 _heartbeat = usecTimestampNow();
400+ _paused = false;
399401 connect(qApp, &QCoreApplication::aboutToQuit, [this] {
400402 _quit = true;
401403 });
@@ -413,11 +415,20 @@ public: · 11 unmodified lines
413415 *crashTrigger = 0xDEAD10CC;
414416 }
415417
418+ static void pause() {
419+ _paused = true;
420+ }
421+
422+ static void resume() {
423+ _paused = false;
424+ updateHeartbeat();
425+ }
426+
416427 void run() override {
417428 while (!_quit) {
418429 QThread::sleep(HEARTBEAT_UPDATE_INTERVAL_SECS);
419430 // Don't do heartbeat detection under nsight
420− if (nsightActive()) {
431+ if (nsightActive() || _paused) {
421432 continue;
422433 }
423434 uint64_t lastHeartbeat = _heartbeat; // sample atomic _heartbeat, because we could context switch away and have it updated on us
@@ -473,6 +484,7 @@ public: · 49 unmodified lines
473484 }
474485 }
475486
487+ static std::atomic<bool> _paused;
476488 static std::atomic<uint64_t> _heartbeat;
477489 static std::atomic<uint64_t> _maxElapsed;
478490 static std::atomic<int> _maxElapsedAverage;
@@ -481,6 +493,7 @@ public: · 2 unmodified lines
481493 bool _quit { false };
482494 };
483495
496+std::atomic<bool> DeadlockWatchdogThread::_paused;
484497 std::atomic<uint64_t> DeadlockWatchdogThread::_heartbeat;
485498 std::atomic<uint64_t> DeadlockWatchdogThread::_maxElapsed;
486499 std::atomic<int> DeadlockWatchdogThread::_maxElapsedAverage;
@@ -656,8 +669,6 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) { · 169 unmodified lines
656669 }
657670 #endif
658671
659− Setting::init();
660−
661672 // Tell the plugin manager about our statically linked plugins
662673 auto pluginManager = PluginManager::getInstance();
663674 pluginManager->setInputPluginProvider([] { return getInputPlugins(); });
@@ -909,6 +920,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 245 unmodified lines
909920
910921 _logger->setSessionID(accountManager->getSessionID());
911922
923+ setCrashAnnotation("metaverse_session_id", accountManager->getSessionID().toString().toStdString());
924+
912925 if (steamClient) {
913926 qCDebug(interfaceapp) << "[VERSION] SteamVR buildID:" << steamClient->getSteamVRBuildID();
914927 }
@@ -2269,6 +2282,11 @@ void Application::initializeGL() { · 1354 unmodified lines
22692282 initDisplay();
22702283 qCDebug(interfaceapp, "Initialized Display.");
22712284
2285+#ifdef Q_OS_OSX
2286+ // FIXME: on mac os the shaders take up to 1 minute to compile, so we pause the deadlock watchdog thread.
2287+ DeadlockWatchdogThread::pause();
2288+#endif
2289+
22722290 // Set up the render engine
22732291 render::CullFunctor cullFunctor = LODManager::shouldRender;
22742292 static const QString RENDER_FORWARD = "HIFI_RENDER_FORWARD";
@@ -2277,6 +2295,11 @@ void Application::initializeGL() { · 2 unmodified lines
22772295 _renderEngine->addJob<SecondaryCameraRenderTask>("SecondaryCameraJob", cullFunctor, !DISABLE_DEFERRED);
22782296 #endif
22792297 _renderEngine->addJob<RenderViewTask>("RenderMainView", cullFunctor, !DISABLE_DEFERRED);
2298+
2299+#ifdef Q_OS_OSX
2300+ DeadlockWatchdogThread::resume();
2301+#endif
2302+
22802303 _renderEngine->load();
22812304 _renderEngine->registerScene(_main3DScene);
22822305
@@ -6272,7 +6295,7 @@ void Application::showAssetServerWidget(QString filePath) { · 3989 unmodified lines
62726295 if (!hmd->getShouldShowTablet() && !isHMDMode()) {
62736296 DependencyManager::get<OffscreenUi>()->show(url, "AssetServer", startUpload);
62746297 } else {
6275− static const QUrl url("../dialogs/TabletAssetServer.qml");
6298+ static const QUrl url("hifi/dialogs/TabletAssetServer.qml");
62766299 tablet->pushOntoStack(url);
62776300 }
62786301 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t