Rewrote parts of the code that were double-locking different objects. This is about half of the code base reviewed.

This commit is contained in:
Diva Canto
2009-10-06 15:39:53 -07:00
parent 99c85b5ef5
commit e992ca0255
9 changed files with 211 additions and 176 deletions

View File

@@ -290,13 +290,14 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
// get the agent. This should work every time, as we just got a packet from it
ScenePresence agent = null;
List<Scene> scenes = null;
lock (m_Scenes)
scenes = new List<Scene>(m_Scenes);
foreach (Scene scene in scenes)
{
foreach (Scene scene in m_Scenes)
{
agent = scene.GetScenePresence(agentID);
if (agent != null) break;
}
agent = scene.GetScenePresence(agentID);
if (agent != null) break;
}
// just to be paranoid...