summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2010-10-18 17:48:14 -0500
committerDave Parks <davep@lindenlab.com>2010-10-18 17:48:14 -0500
commita045261002963fce7a719c9bcffee396aef821ca (patch)
treed232b55888ec1a9018bfdcbb7eeb0557105dc9bc /indra
parent500e8f237623fd0d10a2d0e3225f45572bd4685a (diff)
parent189b71699f082d7852e7d79e25349913cb2d2119 (diff)
merge
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llmeshrepository.cpp34
-rw-r--r--indra/newview/llviewerregion.cpp35
2 files changed, 42 insertions, 27 deletions
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 5f70fb6345..28db665ff9 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -507,9 +507,10 @@ void LLMeshRepoThread::run()
while (!mLODReqQ.empty() && count < MAX_MESH_REQUESTS_PER_SECOND && sActiveLODRequests < sMaxConcurrentRequests)
{
{
- LLMutexLock lock(mMutex);
+ mMutex->lock();
LODRequest req = mLODReqQ.front();
mLODReqQ.pop();
+ mMutex->unlock();
if (fetchMeshLOD(req.mMeshParams, req.mLOD))
{
count++;
@@ -520,9 +521,10 @@ void LLMeshRepoThread::run()
while (!mHeaderReqQ.empty() && count < MAX_MESH_REQUESTS_PER_SECOND && sActiveHeaderRequests < sMaxConcurrentRequests)
{
{
- LLMutexLock lock(mMutex);
+ mMutex->lock();
HeaderRequest req = mHeaderReqQ.front();
mHeaderReqQ.pop();
+ mMutex->unlock();
if (fetchMeshHeader(req.mMeshParams))
{
count++;
@@ -530,7 +532,7 @@ void LLMeshRepoThread::run()
}
}
- {
+ { //mSkinRequests is protected by mSignal
std::set<LLUUID> incomplete;
for (std::set<LLUUID>::iterator iter = mSkinRequests.begin(); iter != mSkinRequests.end(); ++iter)
{
@@ -543,7 +545,7 @@ void LLMeshRepoThread::run()
mSkinRequests = incomplete;
}
- {
+ { //mDecompositionRequests is protected by mSignal
std::set<LLUUID> incomplete;
for (std::set<LLUUID>::iterator iter = mDecompositionRequests.begin(); iter != mDecompositionRequests.end(); ++iter)
{
@@ -556,7 +558,7 @@ void LLMeshRepoThread::run()
mDecompositionRequests = incomplete;
}
- {
+ { //mPhysicsShapeRequests is protected by mSignal
std::set<LLUUID> incomplete;
for (std::set<LLUUID>::iterator iter = mPhysicsShapeRequests.begin(); iter != mPhysicsShapeRequests.end(); ++iter)
{
@@ -608,7 +610,10 @@ void LLMeshRepoThread::loadMeshLOD(const LLVolumeParams& mesh_params, S32 lod)
if (iter != mMeshHeader.end())
{ //if we have the header, request LOD byte range
LODRequest req(mesh_params, lod);
- mLODReqQ.push(req);
+ {
+ LLMutexLock lock(mMutex);
+ mLODReqQ.push(req);
+ }
}
else
{
@@ -626,6 +631,7 @@ void LLMeshRepoThread::loadMeshLOD(const LLVolumeParams& mesh_params, S32 lod)
}
else
{ //if no header request is pending, fetch header
+ LLMutexLock lock(mMutex);
mHeaderReqQ.push(req);
mPendingLOD[mesh_params].push_back(lod);
}
@@ -1043,6 +1049,7 @@ bool LLMeshRepoThread::headerReceived(const LLVolumeParams& mesh_params, U8* dat
pending_lod_map::iterator iter = mPendingLOD.find(mesh_params);
if (iter != mPendingLOD.end())
{
+ LLMutexLock lock(mMutex);
for (U32 i = 0; i < iter->second.size(); ++i)
{
LODRequest req(mesh_params, iter->second[i]);
@@ -1999,6 +2006,7 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason,
{ //retry
LLMeshRepository::sHTTPRetryCount++;
LLMeshRepoThread::HeaderRequest req(mMeshParams);
+ LLMutexLock lock(gMeshRepo.mThread->mMutex);
gMeshRepo.mThread->mHeaderReqQ.push(req);
}
}
@@ -2401,7 +2409,7 @@ void LLMeshRepository::notifyDecompositionReceived(LLMeshDecomposition* decomp)
}
void LLMeshRepository::notifyMeshLoaded(const LLVolumeParams& mesh_params, LLVolume* volume)
-{
+{ //called from main thread
S32 detail = LLVolumeLODGroup::getVolumeDetailFromScale(volume->getDetail());
//get list of objects waiting to be notified this mesh is loaded
@@ -2444,7 +2452,7 @@ void LLMeshRepository::notifyMeshLoaded(const LLVolumeParams& mesh_params, LLVol
}
void LLMeshRepository::notifyMeshUnavailable(const LLVolumeParams& mesh_params, S32 lod)
-{
+{ //called from main thread
//get list of objects waiting to be notified this mesh is loaded
mesh_load_map::iterator obj_iter = mLoadingMeshes[lod].find(mesh_params);
@@ -2926,12 +2934,16 @@ LLSD LLMeshUploadThread::createObject(LLModelInstance& instance)
object_params["extra_parameters"].append(extra_parameter);
LLPermissions perm;
- perm.setNextOwnerBits(gAgent.getID(), LLUUID::null, TRUE, LLFloaterPerms::getNextOwnerPerms());
- perm.setGroupBits(gAgent.getID(), LLUUID::null, TRUE, LLFloaterPerms::getGroupPerms());
- perm.setEveryoneBits(gAgent.getID(), LLUUID::null, TRUE, LLFloaterPerms::getEveryonePerms());
perm.setOwnerAndGroup(gAgent.getID(), gAgent.getID(), LLUUID::null, false);
perm.setCreator(gAgent.getID());
+ perm.initMasks(PERM_ITEM_UNRESTRICTED, //base
+ PERM_ITEM_UNRESTRICTED, //owner
+ LLFloaterPerms::getEveryonePerms(),
+ LLFloaterPerms::getGroupPerms(),
+ LLFloaterPerms::getNextOwnerPerms());
+
+
object_params["permissions"] = ll_create_sd_from_permissions(perm);
object_params["physics_shape_type"] = (U8)(LLViewerObject::PHYSICS_SHAPE_CONVEX_HULL);
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index efaa68db0c..45690c0b8e 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -1070,30 +1070,33 @@ void LLViewerRegion::cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinary
// AND the CRC matches. JC
LLDataPacker *LLViewerRegion::getDP(U32 local_id, U32 crc)
{
- llassert(mCacheLoaded);
+ //llassert(mCacheLoaded); This assert failes often, changing to early-out -- davep, 2010/10/18
- LLVOCacheEntry* entry = get_if_there(mCacheMap, local_id, (LLVOCacheEntry*)NULL);
-
- if (entry)
+ if (mCacheLoaded)
{
- // we've seen this object before
- if (entry->getCRC() == crc)
+ LLVOCacheEntry* entry = get_if_there(mCacheMap, local_id, (LLVOCacheEntry*)NULL);
+
+ if (entry)
{
- // Record a hit
- entry->recordHit();
- return entry->getDP(crc);
+ // we've seen this object before
+ if (entry->getCRC() == crc)
+ {
+ // Record a hit
+ entry->recordHit();
+ return entry->getDP(crc);
+ }
+ else
+ {
+ // llinfos << "CRC miss for " << local_id << llendl;
+ mCacheMissCRC.put(local_id);
+ }
}
else
{
- // llinfos << "CRC miss for " << local_id << llendl;
- mCacheMissCRC.put(local_id);
+ // llinfos << "Cache miss for " << local_id << llendl;
+ mCacheMissFull.put(local_id);
}
}
- else
- {
- // llinfos << "Cache miss for " << local_id << llendl;
- mCacheMissFull.put(local_id);
- }
return NULL;
}