From 35f9f2545d6f39ac9ac850fc7fc5dc21da80c7c2 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Tue, 3 Feb 2009 18:06:24 +0000 Subject: * Lock parts while they're being duplicated to prevent possible race conditions with other parts changers * This shouldn't provoke any deadlocks since the callers aren't taking any other locks beforehand --- OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index d026180..c3e3dfc 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -1392,8 +1392,14 @@ namespace OpenSim.Region.Environment.Scenes SetRootPartOwner(m_rootPart, cAgentID, cGroupID); m_rootPart.ScheduleFullUpdate(); } + + List partList; - List partList = new List(m_parts.Values); + lock (m_parts) + { + partList = new List(m_parts.Values); + } + partList.Sort(delegate(SceneObjectPart p1, SceneObjectPart p2) { return p1.LinkNum.CompareTo(p2.LinkNum); -- cgit v1.1