diff options
author | Dave Parks <davep@lindenlab.com> | 2010-11-02 16:32:29 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2010-11-02 16:32:29 -0500 |
commit | c98e6a99f93082ae9cb5c79f72e78ece59582de3 (patch) | |
tree | ac4982e9599e6f71beb4d3c7fc7dbf08c9b5f825 /indra | |
parent | 126c8e371c4c90f23e5f28475cb9e57871e7e7be (diff) |
Better locking of queues when displaying download queue status.
Reviewed by Nyx.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index d7291c3688..bf712dea11 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -636,12 +636,15 @@ public: } } - S32 pending = (S32) gMeshRepo.mPendingRequests.size(); - S32 header = (S32) gMeshRepo.mThread->mHeaderReqQ.size(); - S32 lod = (S32) gMeshRepo.mThread->mLODReqQ.size(); - - if (pending + header + lod + LLMeshRepoThread::sActiveHeaderRequests + LLMeshRepoThread::sActiveLODRequests != 0) + if (!gMeshRepo.mPendingRequests.empty() || + !gMeshRepo.mThread->mHeaderReqQ.empty() || + !gMeshRepo.mThread->mLODReqQ.empty()) { + LLMutexLock lock(gMeshRepo.mThread->mMutex); + S32 pending = (S32) gMeshRepo.mPendingRequests.size(); + S32 header = (S32) gMeshRepo.mThread->mHeaderReqQ.size(); + S32 lod = (S32) gMeshRepo.mThread->mLODReqQ.size(); + addText(xpos, ypos, llformat ("Mesh Queue - %d pending (%d:%d header | %d:%d LOD)", pending, LLMeshRepoThread::sActiveHeaderRequests, header, |