aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-11-02 18:12:12 +0000
committerJustin Clark-Casey (justincc)2011-11-02 18:25:03 +0000
commit03993d0b14599358ac30a001cebd5b2145881c65 (patch)
treebb875b81821c0dff0bf195d530ad2f2dda96b2d0 /OpenSim/Region/Framework
parentCatch any exceptions exiting the top of the robust console, as we already do ... (diff)
downloadopensim-SC_OLD-03993d0b14599358ac30a001cebd5b2145881c65.zip
opensim-SC_OLD-03993d0b14599358ac30a001cebd5b2145881c65.tar.gz
opensim-SC_OLD-03993d0b14599358ac30a001cebd5b2145881c65.tar.bz2
opensim-SC_OLD-03993d0b14599358ac30a001cebd5b2145881c65.tar.xz
Fix race condition that would sometimes send or save appearance for the wrong avatar.
In AvatarFactoryModule.HandleAppearanceUpdateTimer(), we loop through appearance save and send requests and dispatch via a FireAndForget thread. If there was more than one request in the save or send queue, then this led to a subtle race condition where the foreach loop would load in the next KeyValuePair before the thread was dispatched. This gave the thread the wrong avatar ID, leaving some avatar appearance cloudy since appearance data was never sent. This change loads the fields into local references so that this doesn't happen.
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs5
1 files changed, 3 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 29966f9..3e3fb0f 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2628,7 +2628,8 @@ namespace OpenSim.Region.Framework.Scenes
2628 /// </summary> 2628 /// </summary>
2629 public void SendAppearanceToAllOtherAgents() 2629 public void SendAppearanceToAllOtherAgents()
2630 { 2630 {
2631 //m_log.DebugFormat("[SCENE PRESENCE] SendAppearanceToAllOtherAgents: {0} ({1})", Name, UUID); 2631// m_log.DebugFormat("[SCENE PRESENCE] SendAppearanceToAllOtherAgents: {0} {1}", Name, UUID);
2632
2632 // only send update from root agents to other clients; children are only "listening posts" 2633 // only send update from root agents to other clients; children are only "listening posts"
2633 if (IsChildAgent) 2634 if (IsChildAgent)
2634 { 2635 {
@@ -2656,7 +2657,7 @@ namespace OpenSim.Region.Framework.Scenes
2656 /// </summary> 2657 /// </summary>
2657 public void SendOtherAgentsAppearanceToMe() 2658 public void SendOtherAgentsAppearanceToMe()
2658 { 2659 {
2659 //m_log.DebugFormat("[SCENE PRESENCE] SendOtherAgentsAppearanceToMe: {0} ({1})", Name, UUID); 2660// m_log.DebugFormat("[SCENE PRESENCE] SendOtherAgentsAppearanceToMe: {0} {1}", Name, UUID);
2660 2661
2661 int count = 0; 2662 int count = 0;
2662 m_scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence) 2663 m_scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence)