Reverting this for now, but this needs to go in again.

Revert "Another stab at http://opensimulator.org/mantis/view.php?id=4858. Eliminated more nested locks."

This reverts commit ffbae52a13.
prebuild-update
Diva Canto 2010-07-19 16:22:29 -07:00
parent ffbae52a13
commit c0d9ab941d
1 changed files with 33 additions and 41 deletions

View File

@ -701,9 +701,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
} }
} }
ScriptInstance instance = null;
lock (m_Scripts) lock (m_Scripts)
{ {
ScriptInstance instance = null;
// Create the object record // Create the object record
if ((!m_Scripts.ContainsKey(itemID)) || if ((!m_Scripts.ContainsKey(itemID)) ||
@ -786,7 +786,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
m_Scripts[itemID] = instance; m_Scripts[itemID] = instance;
} }
}
lock (m_PrimObjects) lock (m_PrimObjects)
{ {
@ -808,7 +807,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
if (instance!=null) if (instance!=null)
instance.Init(); instance.Init();
}
return true; return true;
} }
@ -1008,33 +1007,26 @@ namespace OpenSim.Region.ScriptEngine.XEngine
public bool PostObjectEvent(uint localID, EventParams p) public bool PostObjectEvent(uint localID, EventParams p)
{ {
bool result = false; bool result = false;
List<UUID> uuids = null;
lock (m_PrimObjects) lock (m_PrimObjects)
{ {
if (!m_PrimObjects.ContainsKey(localID)) if (!m_PrimObjects.ContainsKey(localID))
return false; return false;
uuids = m_PrimObjects[localID];
}
foreach (UUID itemID in uuids) foreach (UUID itemID in m_PrimObjects[localID])
{
IScriptInstance instance = null;
try
{ {
if (m_Scripts.ContainsKey(itemID)) if (m_Scripts.ContainsKey(itemID))
instance = m_Scripts[itemID]; {
} IScriptInstance instance = m_Scripts[itemID];
catch { /* ignore race conditions */ }
if (instance != null) if (instance != null)
{ {
instance.PostEvent(p); instance.PostEvent(p);
result = true; result = true;
} }
} }
}
}
return result; return result;
} }