Commits

davep committed d39dc09 Draft

MAINT-1311 Thread safe handling of retries on mesh loading failures.

Comments (0)

Files changed (1)

indra/newview/llmeshrepository.cpp

 {
 	if (!LLAppViewer::isQuitting())
 	{
-		LLMutexLock lock(mSignal);
 		loadMeshLOD(mesh_params, lod);
 	}
 }
 
 
 void LLMeshRepoThread::loadMeshLOD(const LLVolumeParams& mesh_params, S32 lod)
-{ //protected by mSignal, no locking needed here
-
+{ //could be called from any thread
+	LLMutexLock lock(mMutex);
 	mesh_header_map::iterator iter = mMeshHeader.find(mesh_params.getSculptID());
 	if (iter != mMeshHeader.end())
 	{ //if we have the header, request LOD byte range
 		LODRequest req(mesh_params, lod);
 		{
-			LLMutexLock lock(mMutex);
 			mLODReqQ.push(req);
 			LLMeshRepository::sLODProcessing++;
 		}
 		}
 		else
 		{ //if no header request is pending, fetch header
-			LLMutexLock lock(mMutex);
 			mHeaderReqQ.push(req);
 			mPendingLOD[mesh_params].push_back(lod);
 		}