diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-03-22 14:54:45 +0200 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-03-22 17:07:40 +0200 |
commit | 4e536adea7acab1ea684ccb1945a6dbd1b52e546 (patch) | |
tree | 723ee85fa5a09acd4e214af99df207655f58e898 /indra/newview/llviewerassetstorage.cpp | |
parent | 625cc84ec0e281e5e68df0486c226ecf521dccde (diff) |
SL-17049 Fixed a crash when adding item 4096 to the queue
Diffstat (limited to 'indra/newview/llviewerassetstorage.cpp')
-rw-r--r-- | indra/newview/llviewerassetstorage.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/indra/newview/llviewerassetstorage.cpp b/indra/newview/llviewerassetstorage.cpp index 6aa1273174..70065cb5a0 100644 --- a/indra/newview/llviewerassetstorage.cpp +++ b/indra/newview/llviewerassetstorage.cpp @@ -353,7 +353,7 @@ void LLViewerAssetStorage::checkForTimeouts() // Restore requests LLCoprocedureManager* manager = LLCoprocedureManager::getInstance(); while (mCoroWaitList.size() > 0 - && manager->count(VIEWER_ASSET_STORAGE_CORO_POOL) < LLCoprocedureManager::DEFAULT_QUEUE_SIZE) + && manager->count(VIEWER_ASSET_STORAGE_CORO_POOL) < (LLCoprocedureManager::DEFAULT_QUEUE_SIZE - 1)) { CoroWaitList &request = mCoroWaitList.front(); @@ -425,13 +425,14 @@ void LLViewerAssetStorage::queueRequestHttp( if (!duplicate) { // Coroutine buffer has fixed size (synchronization buffer, so we have no alternatives), so buffer any request above limit - if (LLCoprocedureManager::instance().count(VIEWER_ASSET_STORAGE_CORO_POOL) < LLCoprocedureManager::DEFAULT_QUEUE_SIZE) + LLCoprocedureManager* manager = LLCoprocedureManager::getInstance(); + if (manager->count(VIEWER_ASSET_STORAGE_CORO_POOL) < (LLCoprocedureManager::DEFAULT_QUEUE_SIZE - 1)) { bool with_http = true; bool is_temp = false; LLViewerAssetStatsFF::record_enqueue(atype, with_http, is_temp); - LLCoprocedureManager::instance().enqueueCoprocedure(VIEWER_ASSET_STORAGE_CORO_POOL, "LLViewerAssetStorage::assetRequestCoro", + manager->enqueueCoprocedure(VIEWER_ASSET_STORAGE_CORO_POOL, "LLViewerAssetStorage::assetRequestCoro", boost::bind(&LLViewerAssetStorage::assetRequestCoro, this, req, uuid, atype, callback, user_data)); } else |