aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorAdam Frisby2008-11-24 15:14:33 +0000
committerAdam Frisby2008-11-24 15:14:33 +0000
commit2a8ff937d513abbd84a96cbfdbe74bc710b60e6a (patch)
treede115ac9c9ebc6266d44f8de673a1fde6f1b9848
parent* Refactored a number of locks into EntityManager to limit the scope of the l... (diff)
downloadopensim-SC_OLD-2a8ff937d513abbd84a96cbfdbe74bc710b60e6a.zip
opensim-SC_OLD-2a8ff937d513abbd84a96cbfdbe74bc710b60e6a.tar.gz
opensim-SC_OLD-2a8ff937d513abbd84a96cbfdbe74bc710b60e6a.tar.bz2
opensim-SC_OLD-2a8ff937d513abbd84a96cbfdbe74bc710b60e6a.tar.xz
* Removed more locks on Entities
* Entities should now in theory be lock-free externally. * Other properties may cause blocking however[?]. * ScenePresence maintains separate locks so isn't fixed by this commit.
-rw-r--r--OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs11
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs24
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs5
3 files changed, 8 insertions, 32 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs
index d33201f..68aee86 100644
--- a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs
@@ -664,16 +664,13 @@ namespace OpenSim.Region.Environment.Modules.World.Land
664 public void UpdateLandPrimCounts() 664 public void UpdateLandPrimCounts()
665 { 665 {
666 ResetAllLandPrimCounts(); 666 ResetAllLandPrimCounts();
667 lock (m_scene.Entities) 667 foreach (EntityBase obj in m_scene.Entities)
668 { 668 {
669 foreach (EntityBase obj in m_scene.Entities) 669 if (obj != null)
670 { 670 {
671 if (obj != null) 671 if ((obj is SceneObjectGroup) && !obj.IsDeleted && !((SceneObjectGroup) obj).IsAttachment)
672 { 672 {
673 if ((obj is SceneObjectGroup) && !((SceneObjectGroup)obj).IsDeleted && !((SceneObjectGroup)obj).IsAttachment) 673 m_scene.EventManager.TriggerParcelPrimCountAdd((SceneObjectGroup) obj);
674 {
675 m_scene.EventManager.TriggerParcelPrimCountAdd((SceneObjectGroup)obj);
676 }
677 } 674 }
678 } 675 }
679 } 676 }
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 55e8634..c20c718 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -244,21 +244,6 @@ namespace OpenSim.Region.Environment.Scenes
244 // set { m_sceneGraph.SceneObjects = value; } 244 // set { m_sceneGraph.SceneObjects = value; }
245 // } 245 // }
246 246
247 /**
248 /// <summary>
249 /// The dictionary of all entities in this scene. The contents of this dictionary may be changed at any time.
250 /// If you wish to add or remove entities, please use the appropriate method for that entity rather than
251 /// editing this dictionary directly.
252 ///
253 /// If you want a list of entities where the list itself is guaranteed not to change, please use
254 /// GetEntities()
255 /// </summary>
256 public Dictionary<UUID, EntityBase> Entities
257 {
258 get { return m_sceneGraph.Entities; }
259 set { m_sceneGraph.Entities = value; }
260 }
261 */
262 public EntityManager Entities 247 public EntityManager Entities
263 { 248 {
264 get { return m_sceneGraph.Entities; } 249 get { return m_sceneGraph.Entities; }
@@ -609,14 +594,11 @@ namespace OpenSim.Region.Environment.Scenes
609 if (ScriptEngine) 594 if (ScriptEngine)
610 { 595 {
611 m_log.Info("Stopping all Scripts in Scene"); 596 m_log.Info("Stopping all Scripts in Scene");
612 lock (Entities) 597 foreach (EntityBase ent in Entities)
613 { 598 {
614 foreach (EntityBase ent in Entities) 599 if (ent is SceneObjectGroup)
615 { 600 {
616 if (ent is SceneObjectGroup) 601 ((SceneObjectGroup) ent).RemoveScriptInstances();
617 {
618 ((SceneObjectGroup)ent).RemoveScriptInstances();
619 }
620 } 602 }
621 } 603 }
622 } 604 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 7ccd71c..17dca98 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -788,10 +788,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
788 } 788 }
789 789
790 EntityBase SensedObject; 790 EntityBase SensedObject;
791 lock (World.Entities) 791 World.Entities.TryGetValue(objecUUID, out SensedObject);
792 {
793 World.Entities.TryGetValue(objecUUID, out SensedObject);
794 }
795 792
796 if (SensedObject == null) 793 if (SensedObject == null)
797 return String.Empty; 794 return String.Empty;