diff options
author | Justin Clarke Casey | 2008-11-12 18:12:18 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-11-12 18:12:18 +0000 |
commit | e2ab576572a3ca7ab1f29fc142624ae257f5289d (patch) | |
tree | 0e4e1c63a87b560996d257309369f918f6c1656b /OpenSim/Region/Environment | |
parent | From: Alan Webb (alan_webb@us.ibm.com) (diff) | |
download | opensim-SC-e2ab576572a3ca7ab1f29fc142624ae257f5289d.zip opensim-SC-e2ab576572a3ca7ab1f29fc142624ae257f5289d.tar.gz opensim-SC-e2ab576572a3ca7ab1f29fc142624ae257f5289d.tar.bz2 opensim-SC-e2ab576572a3ca7ab1f29fc142624ae257f5289d.tar.xz |
* Stop locking the scene presences dictionary for the entire agent crossing part of the login sequence
* This may alleviate a little the freezing experienced by existing avatars when a new client logs in
* Race condition risks look minimal since one wouldn't expect another thread to start fiddling with that presence
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 326380b..ceadf7a 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -2863,7 +2863,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2863 | } | 2863 | } |
2864 | 2864 | ||
2865 | /// <summary> | 2865 | /// <summary> |
2866 | /// | 2866 | /// Triggered when an agent crosses into this sim. Also happens on initial login. |
2867 | /// </summary> | 2867 | /// </summary> |
2868 | /// <param name="regionHandle"></param> | 2868 | /// <param name="regionHandle"></param> |
2869 | /// <param name="agentID"></param> | 2869 | /// <param name="agentID"></param> |
@@ -2873,22 +2873,30 @@ namespace OpenSim.Region.Environment.Scenes | |||
2873 | { | 2873 | { |
2874 | if (regionHandle == m_regInfo.RegionHandle) | 2874 | if (regionHandle == m_regInfo.RegionHandle) |
2875 | { | 2875 | { |
2876 | ScenePresence presence; | ||
2877 | |||
2876 | lock (m_scenePresences) | 2878 | lock (m_scenePresences) |
2877 | { | 2879 | { |
2878 | if (m_scenePresences.ContainsKey(agentID)) | 2880 | m_scenePresences.TryGetValue(agentID, out presence); |
2881 | } | ||
2882 | |||
2883 | if (presence != null) | ||
2884 | { | ||
2885 | try | ||
2879 | { | 2886 | { |
2880 | try | 2887 | presence.MakeRootAgent(position, isFlying); |
2881 | { | 2888 | } |
2882 | m_scenePresences[agentID].MakeRootAgent(position, isFlying); | 2889 | catch (Exception e) |
2883 | } | 2890 | { |
2884 | catch (Exception e) | 2891 | m_log.ErrorFormat("[SCENE]: Unable to do agent crossing, exception {0}", e); |
2885 | { | ||
2886 | m_log.Info("[SCENE]: Unable to do Agent Crossing."); | ||
2887 | m_log.Debug("[SCENE]: " + e.ToString()); | ||
2888 | } | ||
2889 | //m_innerScene.SwapRootChildAgent(false); | ||
2890 | } | 2892 | } |
2891 | } | 2893 | } |
2894 | else | ||
2895 | { | ||
2896 | m_log.ErrorFormat( | ||
2897 | "[SCENE]: Could not find presence for agent {0} crossing into scene {1}", | ||
2898 | agentID, RegionInfo.RegionName); | ||
2899 | } | ||
2892 | } | 2900 | } |
2893 | } | 2901 | } |
2894 | 2902 | ||