diff options
author | Adam Frisby | 2008-11-24 15:14:33 +0000 |
---|---|---|
committer | Adam Frisby | 2008-11-24 15:14:33 +0000 |
commit | 2a8ff937d513abbd84a96cbfdbe74bc710b60e6a (patch) | |
tree | de115ac9c9ebc6266d44f8de673a1fde6f1b9848 /OpenSim/Region/Environment | |
parent | * Refactored a number of locks into EntityManager to limit the scope of the l... (diff) | |
download | opensim-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.
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs | 11 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 24 |
2 files changed, 7 insertions, 28 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 | } |