Skip to content
Snippets Groups Projects
Commit f06ebd05 authored by Andrey Kleshchev's avatar Andrey Kleshchev
Browse files

SL-14807 Missed a pool init in unused constructor, additional protections

parent 4a3e32e7
No related branches found
No related tags found
No related merge requests found
...@@ -140,11 +140,22 @@ LLCoprocedureManager::~LLCoprocedureManager() ...@@ -140,11 +140,22 @@ LLCoprocedureManager::~LLCoprocedureManager()
void LLCoprocedureManager::initializePool(const std::string &poolName) void LLCoprocedureManager::initializePool(const std::string &poolName)
{ {
poolMap_t::iterator it = mPoolMap.find(poolName);
if (it != mPoolMap.end())
{
// Pools are not supposed to be initialized twice
// Todo: ideally restrict init to STATE_FIRST
LL_ERRS() << "Pool is already present " << poolName << LL_ENDL;
return;
}
// Attempt to look up a pool size in the configuration. If found use that // Attempt to look up a pool size in the configuration. If found use that
std::string keyName = "PoolSize" + poolName; std::string keyName = "PoolSize" + poolName;
int size = 0; int size = 0;
LL_ERRS_IF(poolName.empty(), "CoprocedureManager") << "Poolname must not be empty" << LL_ENDL; LL_ERRS_IF(poolName.empty(), "CoprocedureManager") << "Poolname must not be empty" << LL_ENDL;
LL_INFOS("CoprocedureManager") << "Initializing pool " << poolName << LL_ENDL;
if (mPropertyQueryFn) if (mPropertyQueryFn)
{ {
......
...@@ -115,6 +115,7 @@ LLViewerAssetStorage::LLViewerAssetStorage(LLMessageSystem *msg, LLXferManager * ...@@ -115,6 +115,7 @@ LLViewerAssetStorage::LLViewerAssetStorage(LLMessageSystem *msg, LLXferManager *
mCountSucceeded(0), mCountSucceeded(0),
mTotalBytesFetched(0) mTotalBytesFetched(0)
{ {
LLCoprocedureManager::instance().initializePool(VIEWER_ASSET_STORAGE_CORO_POOL);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment