diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-04-20 23:15:04 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-04-21 20:43:50 +0300 |
commit | cf7bc4406e983b3779db0bffff8057b36702cf8d (patch) | |
tree | f67c0ddbf68f6d0fa3a94da2f86f53f02a7d6c88 /indra/newview/llappviewer.cpp | |
parent | e0c4304e4aaebcaaca3897e26232ffa854310b0b (diff) |
SL-17159 Crash initializing LLInstanceTrackerPrivate
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r-- | indra/newview/llappviewer.cpp | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 787503a6e4..f89ab586d5 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -637,6 +637,7 @@ LLAppViewer::LLAppViewer() mLogoutMarkerFile(), mReportedCrash(false), mNumSessions(0), + mGeneralThreadPool(nullptr), mPurgeCache(false), mPurgeCacheOnExit(false), mPurgeUserDataOnExit(false), @@ -1712,11 +1713,6 @@ void LLAppViewer::flushLFSIO() bool LLAppViewer::cleanup() { - // Since we don't know what functions are going to be queued by - // onCleanup(), we have to assume they might rely on some of the things - // we're about to destroy below. Run them first. - mOnCleanup(); - LLAtmosphere::cleanupClass(); //ditch LLVOAvatarSelf instance @@ -2070,6 +2066,10 @@ bool LLAppViewer::cleanup() sTextureCache->shutdown(); sImageDecodeThread->shutdown(); sPurgeDiskCacheThread->shutdown(); + if (mGeneralThreadPool) + { + mGeneralThreadPool->close(); + } sTextureFetch->shutDownTextureCacheThread() ; sTextureFetch->shutDownImageDecodeThread() ; @@ -2094,6 +2094,8 @@ bool LLAppViewer::cleanup() mFastTimerLogThread = NULL; delete sPurgeDiskCacheThread; sPurgeDiskCacheThread = NULL; + delete mGeneralThreadPool; + mGeneralThreadPool = NULL; if (LLFastTimerView::sAnalyzePerformance) { @@ -2179,6 +2181,24 @@ bool LLAppViewer::cleanup() return true; } +void LLAppViewer::initGeneralThread() +{ + if (mGeneralThreadPool) + { + return; + } + + LLSD poolSizes{ gSavedSettings.getLLSD("ThreadPoolSizes") }; + LLSD sizeSpec{ poolSizes["General"] }; + LLSD::Integer poolSize{ sizeSpec.isInteger() ? sizeSpec.asInteger() : 3 }; + LL_DEBUGS("ThreadPool") << "Instantiating General pool with " + << poolSize << " threads" << LL_ENDL; + // We don't want anyone, especially the main thread, to have to block + // due to this ThreadPool being full. + mGeneralThreadPool = new LL::ThreadPool("General", poolSize, 1024 * 1024); + mGeneralThreadPool->start(); +} + bool LLAppViewer::initThreads() { static const bool enable_threads = true; |