Change locking to not mix explicit Monitor.* calls with lock()

mysql-performance
Melanie 2009-12-06 01:20:39 +00:00
parent 5259a32319
commit f71025aeed
1 changed files with 12 additions and 2 deletions

View File

@ -1562,7 +1562,8 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="childPrims"></param> /// <param name="childPrims"></param>
protected internal void LinkObjects(IClientAPI client, uint parentPrimId, List<uint> childPrimIds) protected internal void LinkObjects(IClientAPI client, uint parentPrimId, List<uint> childPrimIds)
{ {
lock (m_updateLock) Monitor.Enter(m_updateLock);
try
{ {
SceneObjectGroup parentGroup = GetGroupByPrim(parentPrimId); SceneObjectGroup parentGroup = GetGroupByPrim(parentPrimId);
@ -1617,6 +1618,10 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
} }
finally
{
Monitor.Exit(m_updateLock);
}
} }
/// <summary> /// <summary>
@ -1630,7 +1635,8 @@ namespace OpenSim.Region.Framework.Scenes
protected internal void DelinkObjects(List<uint> primIds, bool sendEvents) protected internal void DelinkObjects(List<uint> primIds, bool sendEvents)
{ {
lock (m_updateLock) Monitor.Enter(m_updateLock);
try
{ {
List<SceneObjectPart> childParts = new List<SceneObjectPart>(); List<SceneObjectPart> childParts = new List<SceneObjectPart>();
List<SceneObjectPart> rootParts = new List<SceneObjectPart>(); List<SceneObjectPart> rootParts = new List<SceneObjectPart>();
@ -1737,6 +1743,10 @@ namespace OpenSim.Region.Framework.Scenes
g.ScheduleGroupForFullUpdate(); g.ScheduleGroupForFullUpdate();
} }
} }
finally
{
Monitor.Exit(m_updateLock);
}
} }
protected internal void MakeObjectSearchable(IClientAPI remoteClient, bool IncludeInSearch, uint localID) protected internal void MakeObjectSearchable(IClientAPI remoteClient, bool IncludeInSearch, uint localID)