aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneGraph.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-08-28 00:40:33 +0100
committerJustin Clark-Casey (justincc)2010-08-28 00:40:33 +0100
commit1c0b4457cdcd543f04bc818a987f6e3f2311098d (patch)
tree56b6a949423b5ca0f54b2c200e037052a9ac3ff0 /OpenSim/Region/Framework/Scenes/SceneGraph.cs
parentminor: reduce log chattiness of "load iar" for IARs with lots of folders (diff)
downloadopensim-SC_OLD-1c0b4457cdcd543f04bc818a987f6e3f2311098d.zip
opensim-SC_OLD-1c0b4457cdcd543f04bc818a987f6e3f2311098d.tar.gz
opensim-SC_OLD-1c0b4457cdcd543f04bc818a987f6e3f2311098d.tar.bz2
opensim-SC_OLD-1c0b4457cdcd543f04bc818a987f6e3f2311098d.tar.xz
Improve liveness by operating on list copies of SOG.Children where appropriate
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneGraph.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs51
1 files changed, 26 insertions, 25 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 9db2691..2c242c9 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -380,34 +380,35 @@ namespace OpenSim.Region.Framework.Scenes
380 part.Shape.Scale = scale; 380 part.Shape.Scale = scale;
381 } 381 }
382 } 382 }
383
384 m_numPrim += sceneObject.Children.Count;
385 }
383 386
384 sceneObject.AttachToScene(m_parentScene); 387 sceneObject.AttachToScene(m_parentScene);
385 388
386 if (sendClientUpdates) 389 if (sendClientUpdates)
387 sceneObject.ScheduleGroupForFullUpdate(); 390 sceneObject.ScheduleGroupForFullUpdate();
388 391
389 Entities.Add(sceneObject); 392 Entities.Add(sceneObject);
390 m_numPrim += sceneObject.Children.Count; 393
391 394 if (attachToBackup)
392 if (attachToBackup) 395 sceneObject.AttachToBackup();
393 sceneObject.AttachToBackup(); 396
394 397 if (OnObjectCreate != null)
395 if (OnObjectCreate != null) 398 OnObjectCreate(sceneObject);
396 OnObjectCreate(sceneObject); 399
400 lock (SceneObjectGroupsByFullID)
401 {
402 SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject;
403 foreach (SceneObjectPart part in sceneObject.Children.Values)
404 SceneObjectGroupsByFullID[part.UUID] = sceneObject;
405 }
397 406
398 lock (SceneObjectGroupsByFullID) 407 lock (SceneObjectGroupsByLocalID)
399 { 408 {
400 SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject; 409 SceneObjectGroupsByLocalID[sceneObject.LocalId] = sceneObject;
401 foreach (SceneObjectPart part in sceneObject.Children.Values) 410 foreach (SceneObjectPart part in sceneObject.Children.Values)
402 SceneObjectGroupsByFullID[part.UUID] = sceneObject; 411 SceneObjectGroupsByLocalID[part.LocalId] = sceneObject;
403 }
404
405 lock (SceneObjectGroupsByLocalID)
406 {
407 SceneObjectGroupsByLocalID[sceneObject.LocalId] = sceneObject;
408 foreach (SceneObjectPart part in sceneObject.Children.Values)
409 SceneObjectGroupsByLocalID[part.LocalId] = sceneObject;
410 }
411 } 412 }
412 } 413 }
413 414