From fd37a21b59836143f50fdf994c691d65bd641d52 Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Wed, 12 May 2010 08:34:47 -0700 Subject: Kill some locks that have crept into SOG --- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 35134d6..a4b8944 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -3651,7 +3651,8 @@ namespace OpenSim.Region.Framework.Scenes if (atRotTargets.Count > 0) { uint[] localids = new uint[0]; - lock (m_parts) + lockPartsForRead(true); + try { localids = new uint[m_parts.Count]; int cntr = 0; @@ -3661,6 +3662,10 @@ namespace OpenSim.Region.Framework.Scenes cntr++; } } + finally + { + lockPartsForRead(false); + } for (int ctr = 0; ctr < localids.Length; ctr++) { @@ -3679,7 +3684,8 @@ namespace OpenSim.Region.Framework.Scenes { //trigger not_at_target uint[] localids = new uint[0]; - lock (m_parts) + lockPartsForRead(true); + try { localids = new uint[m_parts.Count]; int cntr = 0; @@ -3689,6 +3695,10 @@ namespace OpenSim.Region.Framework.Scenes cntr++; } } + finally + { + lockPartsForRead(false); + } for (int ctr = 0; ctr < localids.Length; ctr++) { -- cgit v1.1