From 2f81e53f63012f0ed1623dc6159da01a3807fbf6 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 15 Mar 2012 00:20:47 +0000 Subject: Fix a problem where multiple near simultaneous calls to llDie() from multiple scripts in the same linkset can cause unnecessary thread aborts. The first llDie() could lock Scene.m_deleting_scene_object. The second llDie() would then wait at this lock. The first llDie() would go on to remove the second script but always abort it since the second script's WorkItem would not go away. Easiest solution here is to remove the m_deleting_scene_object since it's no longer justified - we no longer lock m_parts but take a copy instead. This also requires an adjustment in XEngine.OnRemoveScript not to use instance.ObjectID instead when firing the OnObjectRemoved event. --- OpenSim/Region/Framework/Scenes/Scene.cs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 9e59d50..3a066d4 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -219,8 +219,6 @@ namespace OpenSim.Region.Framework.Scenes private int m_lastUpdate; private bool m_firstHeartbeat = true; - - private object m_deleting_scene_object = new object(); private UpdatePrioritizationSchemes m_priorityScheme = UpdatePrioritizationSchemes.Time; private bool m_reprioritizationEnabled = true; @@ -1994,15 +1992,8 @@ namespace OpenSim.Region.Framework.Scenes public void DeleteSceneObject(SceneObjectGroup group, bool silent) { // m_log.DebugFormat("[SCENE]: Deleting scene object {0} {1}", group.Name, group.UUID); - - //SceneObjectPart rootPart = group.GetChildPart(group.UUID); - // Serialise calls to RemoveScriptInstances to avoid - // deadlocking on m_parts inside SceneObjectGroup - lock (m_deleting_scene_object) - { - group.RemoveScriptInstances(true); - } + group.RemoveScriptInstances(true); SceneObjectPart[] partList = group.Parts; -- cgit v1.1