summaryrefslogtreecommitdiff
path: root/indra/newview/llmeshrepository.cpp
diff options
context:
space:
mode:
authorMonty Brandenberg <monty@lindenlab.com>2013-09-20 07:13:14 +0000
committerMonty Brandenberg <monty@lindenlab.com>2013-09-20 07:13:14 +0000
commit2462162539053e8cbf26aea68940f300bca5aa87 (patch)
treea441f7a5836f5fed4938cc2c3634dcffa7252cf5 /indra/newview/llmeshrepository.cpp
parentcbf7e90954e69f86cbf530676e165f2feb6501bb (diff)
Move from std::queue to std::list which has better
behavior and swap() as well. Should probably do this for the other queues at some point.
Diffstat (limited to 'indra/newview/llmeshrepository.cpp')
-rwxr-xr-xindra/newview/llmeshrepository.cpp26
1 files changed, 12 insertions, 14 deletions
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 23a9640761..b55ba758e1 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -1715,7 +1715,7 @@ bool LLMeshRepoThread::skinInfoReceived(const LLUUID& mesh_id, U8* data, S32 dat
// LL_DEBUGS(LOG_MESH) << "info pelvis offset" << info.mPelvisOffset << LL_ENDL;
{
LLMutexLock lock(mMutex);
- mSkinInfoQ.push(info);
+ mSkinInfoQ.push_back(info);
}
}
@@ -1745,7 +1745,7 @@ bool LLMeshRepoThread::decompositionReceived(const LLUUID& mesh_id, U8* data, S3
d->mMeshID = mesh_id;
{
LLMutexLock lock(mMutex);
- mDecompositionQ.push(d);
+ mDecompositionQ.push_back(d);
}
}
@@ -1807,7 +1807,7 @@ bool LLMeshRepoThread::physicsShapeReceived(const LLUUID& mesh_id, U8* data, S32
{
LLMutexLock lock(mMutex);
- mDecompositionQ.push(d);
+ mDecompositionQ.push_back(d);
}
return true;
}
@@ -2473,33 +2473,31 @@ void LLMeshRepoThread::notifyLoadedMeshes()
{
if (mMutex->trylock())
{
- std::queue<LLMeshSkinInfo> skin_info_q;
- std::queue<LLModel::Decomposition*> decomp_q;
+ std::list<LLMeshSkinInfo> skin_info_q;
+ std::list<LLModel::Decomposition*> decomp_q;
- // swap() comes to std::queue in c++11 so copy manually for now
- while (! mSkinInfoQ.empty())
+ if (! mSkinInfoQ.empty())
{
- skin_info_q.push(mSkinInfoQ.front());
- mSkinInfoQ.pop();
+ skin_info_q.swap(mSkinInfoQ);
}
- while (! mDecompositionQ.empty())
+ if (! mDecompositionQ.empty())
{
- decomp_q.push(mDecompositionQ.front());
- mDecompositionQ.pop();
+ decomp_q.swap(mDecompositionQ);
}
+
mMutex->unlock();
// Process the elements free of the lock
while (! skin_info_q.empty())
{
gMeshRepo.notifySkinInfoReceived(skin_info_q.front());
- skin_info_q.pop();
+ skin_info_q.pop_front();
}
while (! decomp_q.empty())
{
gMeshRepo.notifyDecompositionReceived(decomp_q.front());
- decomp_q.pop();
+ decomp_q.pop_front();
}
}
}