From 03993d0b14599358ac30a001cebd5b2145881c65 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 2 Nov 2011 18:12:12 +0000 Subject: 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. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework') 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 /// public void SendAppearanceToAllOtherAgents() { - //m_log.DebugFormat("[SCENE PRESENCE] SendAppearanceToAllOtherAgents: {0} ({1})", Name, UUID); +// m_log.DebugFormat("[SCENE PRESENCE] SendAppearanceToAllOtherAgents: {0} {1}", Name, UUID); + // only send update from root agents to other clients; children are only "listening posts" if (IsChildAgent) { @@ -2656,7 +2657,7 @@ namespace OpenSim.Region.Framework.Scenes /// public void SendOtherAgentsAppearanceToMe() { - //m_log.DebugFormat("[SCENE PRESENCE] SendOtherAgentsAppearanceToMe: {0} ({1})", Name, UUID); +// m_log.DebugFormat("[SCENE PRESENCE] SendOtherAgentsAppearanceToMe: {0} {1}", Name, UUID); int count = 0; m_scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence) -- cgit v1.1