Tiny bit of code consolidation in lltexturefetch

This commit is contained in:
Shyotl
2012-11-09 18:42:37 -06:00
parent b6efc9f583
commit 1cb75c4471
2 changed files with 10 additions and 18 deletions

View File

@@ -2160,27 +2160,19 @@ void LLTextureFetch::deleteRequest(const LLUUID& id, bool cancel)
{
lockQueue() ;
LLTextureFetchWorker* worker = getWorkerAfterLock(id);
if (worker)
{
size_t erased_1 = mRequestMap.erase(worker->mID);
unlockQueue() ;
llassert_always(erased_1 > 0) ;
removeFromNetworkQueue(worker, cancel);
llassert_always(!(worker->getFlags(LLWorkerClass::WCF_DELETE_REQUESTED))) ;
worker->scheduleDelete();
}
else
{
unlockQueue() ;
}
removeRequest(worker, cancel, false);
}
void LLTextureFetch::removeRequest(LLTextureFetchWorker* worker, bool cancel)
void LLTextureFetch::removeRequest(LLTextureFetchWorker* worker, bool cancel, bool bNeedsLock)
{
lockQueue() ;
if(!worker)
{
return;
}
if(bNeedsLock)
lockQueue() ;
size_t erased_1 = mRequestMap.erase(worker->mID);
unlockQueue() ;

View File

@@ -121,7 +121,7 @@ protected:
void removeFromNetworkQueue(LLTextureFetchWorker* worker, bool cancel);
void addToHTTPQueue(const LLUUID& id);
void removeFromHTTPQueue(const LLUUID& id, S32 received_size = 0);
void removeRequest(LLTextureFetchWorker* worker, bool cancel);
void removeRequest(LLTextureFetchWorker* worker, bool cancel, bool bNeedsLock = true);
// Overrides from the LLThread tree
bool runCondition();