aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneGraph.cs
diff options
context:
space:
mode:
authordiva2009-01-15 23:37:49 +0000
committerdiva2009-01-15 23:37:49 +0000
commite80dcfa9f6eb14f67f7a7bdf4ae7a596323e156c (patch)
treeb8db94a7c2093843a351744471a03f6e6ad32854 /OpenSim/Region/Environment/Scenes/SceneGraph.cs
parent* Delete OpenSim/Framework/OpenJpeg for now, with Teravus' permission ;) (diff)
downloadopensim-SC_OLD-e80dcfa9f6eb14f67f7a7bdf4ae7a596323e156c.zip
opensim-SC_OLD-e80dcfa9f6eb14f67f7a7bdf4ae7a596323e156c.tar.gz
opensim-SC_OLD-e80dcfa9f6eb14f67f7a7bdf4ae7a596323e156c.tar.bz2
opensim-SC_OLD-e80dcfa9f6eb14f67f7a7bdf4ae7a596323e156c.tar.xz
Eased the locking times of ScenePresences. No locks were removed, just the locking periods changed.
* Added an additional lock in GetScenePresences() * Changed ForEachClient to use GetScenePresences() instead of the main ScenePresences dictionary, so that there is no need to lock.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneGraph.cs15
1 files changed, 12 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneGraph.cs b/OpenSim/Region/Environment/Scenes/SceneGraph.cs
index be2fb46..940aee6 100644
--- a/OpenSim/Region/Environment/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneGraph.cs
@@ -774,7 +774,10 @@ namespace OpenSim.Region.Environment.Scenes
774 /// <returns></returns> 774 /// <returns></returns>
775 protected internal List<ScenePresence> GetScenePresences() 775 protected internal List<ScenePresence> GetScenePresences()
776 { 776 {
777 return new List<ScenePresence>(ScenePresences.Values); 777 lock (ScenePresences)
778 {
779 return new List<ScenePresence>(ScenePresences.Values);
780 }
778 } 781 }
779 782
780 protected internal List<ScenePresence> GetAvatars() 783 protected internal List<ScenePresence> GetAvatars()
@@ -1085,12 +1088,18 @@ namespace OpenSim.Region.Environment.Scenes
1085 1088
1086 protected internal void ForEachClient(Action<IClientAPI> action) 1089 protected internal void ForEachClient(Action<IClientAPI> action)
1087 { 1090 {
1088 lock (ScenePresences) 1091 List<ScenePresence> splist = GetScenePresences();
1092 foreach (ScenePresence presence in splist)
1089 { 1093 {
1090 foreach (ScenePresence presence in ScenePresences.Values) 1094 try
1091 { 1095 {
1092 action(presence.ControllingClient); 1096 action(presence.ControllingClient);
1093 } 1097 }
1098 catch (Exception e)
1099 {
1100 // Catch it and move on. This includes situations where splist has inconsistent info
1101 m_log.WarnFormat("[SCENE]: Problem processing action in ForEachClient: ", e.Message);
1102 }
1094 } 1103 }
1095 } 1104 }
1096 1105