diff options
author | Monty Brandenberg <monty@lindenlab.com> | 2013-09-20 05:58:32 +0000 |
---|---|---|
committer | Monty Brandenberg <monty@lindenlab.com> | 2013-09-20 05:58:32 +0000 |
commit | cbf7e90954e69f86cbf530676e165f2feb6501bb (patch) | |
tree | ef0c2284468460664d3836ac7c0aafec7b84af64 /indra/newview/llmeshrepository.cpp | |
parent | a232fa4d9f4bf8f29d2783da8c2e01f7c9f80fd9 (diff) |
Used a c++11 feature unintentionally. Use a more
traditional swap-less object transfer.
Diffstat (limited to 'indra/newview/llmeshrepository.cpp')
-rwxr-xr-x | indra/newview/llmeshrepository.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 5174a7af00..23a9640761 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -2471,16 +2471,25 @@ void LLMeshRepoThread::notifyLoadedMeshes() if (! mSkinInfoQ.empty() || ! mDecompositionQ.empty()) { - std::queue<LLMeshSkinInfo> skin_info_q; - std::queue<LLModel::Decomposition*> decomp_q; - if (mMutex->trylock()) { - // Make thread-shared data private with swap under lock. - skin_info_q.swap(mSkinInfoQ); - decomp_q.swap(mDecompositionQ); + std::queue<LLMeshSkinInfo> skin_info_q; + std::queue<LLModel::Decomposition*> decomp_q; + + // swap() comes to std::queue in c++11 so copy manually for now + while (! mSkinInfoQ.empty()) + { + skin_info_q.push(mSkinInfoQ.front()); + mSkinInfoQ.pop(); + } + while (! mDecompositionQ.empty()) + { + decomp_q.push(mDecompositionQ.front()); + mDecompositionQ.pop(); + } mMutex->unlock(); + // Process the elements free of the lock while (! skin_info_q.empty()) { gMeshRepo.notifySkinInfoReceived(skin_info_q.front()); |