diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 00a3e9369..bb82041fa 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -564,7 +564,6 @@ public: LLMeshRepoThread::LLMeshRepoThread() : LLThread("mesh repo") { - mWaiting = false; mMutex = new LLMutex(); mHeaderMutex = new LLMutex(); mSignal = new LLCondition(); @@ -588,12 +587,9 @@ void LLMeshRepoThread::run() llwarns << "convex decomposition unable to be loaded" << llendl; } + mSignal->lock(); while (!LLApp::isQuitting()) { - mWaiting = true; - mSignal->wait(); - mWaiting = false; - if (!LLApp::isQuitting()) { static U32 count = 0; @@ -2473,10 +2469,11 @@ void LLMeshRepository::notifyLoadedMeshes() //call completed callbacks on finished decompositions mDecompThread->notifyCompleted(); - if (!mThread->mWaiting) + if (!mThread->mSignal->tryLock()) { //curl thread is churning, wait for it to go idle return; } + mThread->mSignal->unlock(); static std::string region_name("never name a region this"); diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index c408f8a12..ab9220cdc 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -225,8 +225,6 @@ public: LLMutex* mHeaderMutex; LLCondition* mSignal; - bool mWaiting; - //map of known mesh headers typedef std::map mesh_header_map; mesh_header_map mMeshHeader;