diff options
-rw-r--r-- | indra/llmessage/llcoproceduremanager.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp index 969cd162fb..2494c31613 100644 --- a/indra/llmessage/llcoproceduremanager.cpp +++ b/indra/llmessage/llcoproceduremanager.cpp @@ -77,12 +77,12 @@ public: /// inline size_t countActive() const { - return mActiveCoprocs.size(); + return mActiveCoprocsCount; } /// Returns the total number of coprocedures either queued or in active processing. /// - inline size_t count() const + inline S32 count() const { return countPending() + countActive(); } @@ -113,12 +113,10 @@ private: // because the consuming coroutine might outlive this LLCoprocedurePool // instance. typedef boost::shared_ptr<CoprocQueue_t> CoprocQueuePtr; - typedef std::map<LLUUID, LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t> ActiveCoproc_t; std::string mPoolName; - size_t mPoolSize, mPending{0}; + size_t mPoolSize, mActiveCoprocsCount, mPending; CoprocQueuePtr mPendingCoprocs; - ActiveCoproc_t mActiveCoprocs; LLTempBoundListener mStatusListener; typedef std::map<std::string, LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t> CoroAdapterMap_t; @@ -281,6 +279,8 @@ void LLCoprocedureManager::close(const std::string &pool) LLCoprocedurePool::LLCoprocedurePool(const std::string &poolName, size_t size): mPoolName(poolName), mPoolSize(size), + mActiveCoprocsCount(0), + mPending(0), mPendingCoprocs(boost::make_shared<CoprocQueue_t>(DEFAULT_QUEUE_SIZE)), mHTTPPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID), mCoroMapping() @@ -406,8 +406,7 @@ void LLCoprocedurePool::coprocedureInvokerCoro( } // we actually popped an item --mPending; - - ActiveCoproc_t::iterator itActive = mActiveCoprocs.insert(ActiveCoproc_t::value_type(coproc->mId, httpAdapter)).first; + mActiveCoprocsCount++; LL_DEBUGS("CoProcMgr") << "Dequeued and invoking coprocedure(" << coproc->mName << ") with id=" << coproc->mId.asString() << " in pool \"" << mPoolName << "\" (" << mPending << " left)" << LL_ENDL; @@ -417,10 +416,6 @@ void LLCoprocedurePool::coprocedureInvokerCoro( } catch (const LLCoros::Stop &) { - LL_INFOS("CoProcMgr") << "Viewer is shutting Down. Stopping coprocedure('" << coproc->mName - << "', id=" << coproc->mId.asString() - << ") in pool '" << mPoolName << "'" << LL_ENDL; - mActiveCoprocs.erase(itActive); throw; // let toplevel handle this as LLContinueError } catch (...) @@ -429,13 +424,13 @@ void LLCoprocedurePool::coprocedureInvokerCoro( << "', id=" << coproc->mId.asString() << ") in pool '" << mPoolName << "'")); // must NOT omit this or we deplete the pool - mActiveCoprocs.erase(itActive); + mActiveCoprocsCount--; continue; } LL_DEBUGS("CoProcMgr") << "Finished coprocedure(" << coproc->mName << ")" << " in pool \"" << mPoolName << "\"" << LL_ENDL; - mActiveCoprocs.erase(itActive); + mActiveCoprocsCount--; } } |