aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:53 -0500
committerJacek Antonelli2008-08-15 23:45:53 -0500
commiteea0e92faa209f23b677fdee964023d0ce6f2fed (patch)
treef8700989d9f799d4e818920ba54516e7cf975376 /linden/indra/newview/llappviewer.cpp
parentSecond Life viewer sources 1.20.7 (diff)
downloadmeta-impy-eea0e92faa209f23b677fdee964023d0ce6f2fed.zip
meta-impy-eea0e92faa209f23b677fdee964023d0ce6f2fed.tar.gz
meta-impy-eea0e92faa209f23b677fdee964023d0ce6f2fed.tar.bz2
meta-impy-eea0e92faa209f23b677fdee964023d0ce6f2fed.tar.xz
Second Life viewer sources 1.20.8
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llappviewer.cpp98
1 files changed, 78 insertions, 20 deletions
diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp
index c6f4cdd..a461dcb 100644
--- a/linden/indra/newview/llappviewer.cpp
+++ b/linden/indra/newview/llappviewer.cpp
@@ -530,7 +530,8 @@ LLAppViewer::LLAppViewer() :
530 mSavedFinalSnapshot(false), 530 mSavedFinalSnapshot(false),
531 mQuitRequested(false), 531 mQuitRequested(false),
532 mLogoutRequestSent(false), 532 mLogoutRequestSent(false),
533 mYieldTime(-1) 533 mYieldTime(-1),
534 mMainloopTimeout(NULL)
534{ 535{
535 if(NULL != sInstance) 536 if(NULL != sInstance)
536 { 537 {
@@ -538,15 +539,16 @@ LLAppViewer::LLAppViewer() :
538 } 539 }
539 540
540 sInstance = this; 541 sInstance = this;
541
542 // Initialize the mainloop timeout.
543 mMainloopTimeout = new LLWatchdogTimeout();
544} 542}
545 543
546LLAppViewer::~LLAppViewer() 544LLAppViewer::~LLAppViewer()
547{ 545{
548 // Initialize the mainloop timeout. 546 if(mMainloopTimeout)
549 delete mMainloopTimeout; 547 {
548 // delete the mainloop timeout.
549 delete mMainloopTimeout;
550 mMainloopTimeout = NULL;
551 }
550 552
551 // If we got to this destructor somehow, the app didn't hang. 553 // If we got to this destructor somehow, the app didn't hang.
552 removeMarkerFile(); 554 removeMarkerFile();
@@ -830,10 +832,6 @@ bool LLAppViewer::init()
830 832
831bool LLAppViewer::mainLoop() 833bool LLAppViewer::mainLoop()
832{ 834{
833 mMainloopTimeout = new LLWatchdogTimeout();
834 // *FIX:Mani - Make this a setting, once new settings exist in this branch.
835 mMainloopTimeout->setTimeout(5);
836
837 //------------------------------------------- 835 //-------------------------------------------
838 // Run main loop until time to quit 836 // Run main loop until time to quit
839 //------------------------------------------- 837 //-------------------------------------------
@@ -933,6 +931,8 @@ bool LLAppViewer::mainLoop()
933 931
934 } 932 }
935 933
934 pauseMainloopTimeout();
935
936 // Sleep and run background threads 936 // Sleep and run background threads
937 { 937 {
938 LLFastTimer t2(LLFastTimer::FTM_SLEEP); 938 LLFastTimer t2(LLFastTimer::FTM_SLEEP);
@@ -1015,7 +1015,9 @@ bool LLAppViewer::mainLoop()
1015 //LLVFSThread::sLocal->pause(); // Prevent the VFS thread from running while rendering. 1015 //LLVFSThread::sLocal->pause(); // Prevent the VFS thread from running while rendering.
1016 //LLLFSThread::sLocal->pause(); // Prevent the LFS thread from running while rendering. 1016 //LLLFSThread::sLocal->pause(); // Prevent the LFS thread from running while rendering.
1017 1017
1018 mMainloopTimeout->ping(); 1018 resumeMainloopTimeout();
1019
1020 pingMainloopTimeout("Mainloop");
1019 } 1021 }
1020 1022
1021 } 1023 }
@@ -1040,7 +1042,11 @@ bool LLAppViewer::mainLoop()
1040 1042
1041 delete gServicePump; 1043 delete gServicePump;
1042 1044
1043 mMainloopTimeout->stop(); 1045 if(mMainloopTimeout)
1046 {
1047 delete mMainloopTimeout;
1048 mMainloopTimeout = NULL;
1049 }
1044 1050
1045 llinfos << "Exiting main_loop" << llendflush; 1051 llinfos << "Exiting main_loop" << llendflush;
1046 1052
@@ -1503,6 +1509,13 @@ bool LLAppViewer::initConfiguration()
1503 LLWindow::getFontListSans()); 1509 LLWindow::getFontListSans());
1504#endif 1510#endif
1505 1511
1512 //*FIX:Mani - Set default to disabling watchdog mainloop
1513 // timeout for mac and linux. There is no call stack info
1514 // on these platform to help debug.
1515#ifndef LL_WINDOWS
1516 gSavedSettings.setBOOL("WatchdogEnabled", FALSE);
1517#endif
1518
1506 // These are warnings that appear on the first experience of that condition. 1519 // These are warnings that appear on the first experience of that condition.
1507 // They are already set in the settings_default.xml file, but still need to be added to LLFirstUse 1520 // They are already set in the settings_default.xml file, but still need to be added to LLFirstUse
1508 // for disable/reset ability 1521 // for disable/reset ability
@@ -2143,6 +2156,12 @@ void LLAppViewer::writeSystemInfo()
2143 gDebugInfo["RAMInfo"] = llformat("%u", gSysMemory.getPhysicalMemoryKB()); 2156 gDebugInfo["RAMInfo"] = llformat("%u", gSysMemory.getPhysicalMemoryKB());
2144 gDebugInfo["OSInfo"] = getOSInfo().getOSStringSimple(); 2157 gDebugInfo["OSInfo"] = getOSInfo().getOSStringSimple();
2145 2158
2159 // *FIX:Mani - move this ddown in llappviewerwin32
2160#ifdef LL_WINDOWS
2161 DWORD thread_id = GetCurrentThreadId();
2162 gDebugInfo["MainloopThreadID"] = (S32)thread_id;
2163#endif
2164
2146 // Dump some debugging info 2165 // Dump some debugging info
2147 LL_INFOS("SystemInfo") << gSecondLife 2166 LL_INFOS("SystemInfo") << gSecondLife
2148 << " version " << LL_VERSION_MAJOR << "." << LL_VERSION_MINOR << "." << LL_VERSION_PATCH 2167 << " version " << LL_VERSION_MAJOR << "." << LL_VERSION_MINOR << "." << LL_VERSION_PATCH
@@ -2227,6 +2246,12 @@ void LLAppViewer::handleViewerCrash()
2227 gDebugInfo["CurrentRegion"] = gAgent.getRegion()->getName(); 2246 gDebugInfo["CurrentRegion"] = gAgent.getRegion()->getName();
2228 } 2247 }
2229 2248
2249 if(LLAppViewer::instance()->mMainloopTimeout)
2250 {
2251 gDebugInfo["MainloopTimeoutState"] = LLAppViewer::instance()->mMainloopTimeout->getState();
2252 }
2253
2254
2230 //Write out the crash status file 2255 //Write out the crash status file
2231 //Use marker file style setup, as that's the simplest, especially since 2256 //Use marker file style setup, as that's the simplest, especially since
2232 //we're already in a crash situation 2257 //we're already in a crash situation
@@ -3397,6 +3422,8 @@ static F32 CheckMessagesMaxTime = CHECK_MESSAGES_DEFAULT_MAX_TIME;
3397 3422
3398void LLAppViewer::idleNetwork() 3423void LLAppViewer::idleNetwork()
3399{ 3424{
3425 pingMainloopTimeout("idleNetwork");
3426
3400 gObjectList.mNumNewObjects = 0; 3427 gObjectList.mNumNewObjects = 0;
3401 S32 total_decoded = 0; 3428 S32 total_decoded = 0;
3402 3429
@@ -3582,18 +3609,49 @@ void LLAppViewer::forceErrorSoftwareException()
3582 throw; 3609 throw;
3583} 3610}
3584 3611
3585void LLAppViewer::startMainloopTimeout(F32 secs) 3612void LLAppViewer::initMainloopTimeout(const std::string& state, F32 secs)
3586{ 3613{
3587 if(secs < 0.0f) 3614 if(!mMainloopTimeout)
3588 { 3615 {
3589 secs = gSavedSettings.getF32("MainloopTimeoutDefault"); 3616 mMainloopTimeout = new LLWatchdogTimeout();
3617 resumeMainloopTimeout(state, secs);
3590 } 3618 }
3591
3592 mMainloopTimeout->setTimeout(secs);
3593 mMainloopTimeout->start();
3594} 3619}
3595 3620
3596void LLAppViewer::stopMainloopTimeout() 3621void LLAppViewer::resumeMainloopTimeout(const std::string& state, F32 secs)
3597{ 3622{
3598 mMainloopTimeout->stop(); 3623 if(mMainloopTimeout)
3624 {
3625 if(secs < 0.0f)
3626 {
3627 secs = gSavedSettings.getF32("MainloopTimeoutDefault");
3628 }
3629
3630 mMainloopTimeout->setTimeout(secs);
3631 mMainloopTimeout->start(state);
3632 }
3633}
3634
3635void LLAppViewer::pauseMainloopTimeout()
3636{
3637 if(mMainloopTimeout)
3638 {
3639 mMainloopTimeout->stop();
3640 }
3599} 3641}
3642
3643void LLAppViewer::pingMainloopTimeout(const std::string& state, F32 secs)
3644{
3645 if(mMainloopTimeout)
3646 {
3647 if(secs < 0.0f)
3648 {
3649 secs = gSavedSettings.getF32("MainloopTimeoutDefault");
3650 }
3651
3652 mMainloopTimeout->setTimeout(secs);
3653 mMainloopTimeout->ping(state);
3654 }
3655}
3656
3657