Rewrote parts of the code that were double-locking different objects. This is about half of the code base reviewed.

This commit is contained in:
Diva Canto
2009-10-06 15:39:53 -07:00
parent 99c85b5ef5
commit e992ca0255
9 changed files with 211 additions and 176 deletions

View File

@@ -187,14 +187,16 @@ namespace OpenSim.Region.CoreModules.World.Land
LandData newData = data.Copy();
newData.LocalID = local_id;
ILandObject land = null;
lock (m_landList)
{
if (m_landList.ContainsKey(local_id))
{
m_landList[local_id].LandData = newData;
m_scene.EventManager.TriggerLandObjectUpdated((uint)local_id, m_landList[local_id]);
land = m_landList[local_id];
}
}
m_scene.EventManager.TriggerLandObjectUpdated((uint)local_id, land);
}
public bool AllowedForcefulBans
@@ -504,6 +506,7 @@ namespace OpenSim.Region.CoreModules.World.Land
/// <param name="local_id">Land.localID of the peice of land to remove.</param>
public void removeLandObject(int local_id)
{
UUID id = UUID.Zero;
lock (m_landList)
{
for (int x = 0; x < 64; x++)
@@ -520,9 +523,10 @@ namespace OpenSim.Region.CoreModules.World.Land
}
}
m_scene.EventManager.TriggerLandObjectRemoved(m_landList[local_id].LandData.GlobalID);
id = m_landList[local_id].LandData.GlobalID;
m_landList.Remove(local_id);
}
m_scene.EventManager.TriggerLandObjectRemoved(id);
}
private void performFinalLandJoin(ILandObject master, ILandObject slave)