Improve locking of RegionCombinerModule.m_regions

0.7.4.1
Justin Clark-Casey (justincc) 2012-05-19 04:59:36 +01:00
parent 5759313f7f
commit 0db60eea85
1 changed files with 29 additions and 24 deletions

View File

@ -58,6 +58,11 @@ namespace OpenSim.Region.RegionCombinerModule
get { return null; } get { return null; }
} }
/// <summary>
/// Is this module enabled?
/// </summary>
private bool enabledYN = false;
/// <summary> /// <summary>
/// This holds the root regions for the megaregions. /// This holds the root regions for the megaregions.
/// </summary> /// </summary>
@ -66,11 +71,6 @@ namespace OpenSim.Region.RegionCombinerModule
/// </remarks> /// </remarks>
private Dictionary<UUID, RegionConnections> m_regions = new Dictionary<UUID, RegionConnections>(); private Dictionary<UUID, RegionConnections> m_regions = new Dictionary<UUID, RegionConnections>();
/// <summary>
/// Is this module enabled?
/// </summary>
private bool enabledYN = false;
/// <summary> /// <summary>
/// The scenes that comprise the megaregion. /// The scenes that comprise the megaregion.
/// </summary> /// </summary>
@ -717,7 +717,6 @@ namespace OpenSim.Region.RegionCombinerModule
{ {
ForwardPermissionRequests(rootConn, r.RegionScene); ForwardPermissionRequests(rootConn, r.RegionScene);
} }
}
// Create the root region's Client Event Forwarder // Create the root region's Client Event Forwarder
rootConn.ClientEventForwarder = new RegionCombinerClientEventForwarder(rootConn); rootConn.ClientEventForwarder = new RegionCombinerClientEventForwarder(rootConn);
@ -728,6 +727,7 @@ namespace OpenSim.Region.RegionCombinerModule
// Adds this root region to a dictionary of regions that are connectable // Adds this root region to a dictionary of regions that are connectable
m_regions.Add(scene.RegionInfo.originRegionID, rootConn); m_regions.Add(scene.RegionInfo.originRegionID, rootConn);
} }
}
private void SetCourseLocationDelegate(ScenePresence presence) private void SetCourseLocationDelegate(ScenePresence presence)
{ {
@ -983,6 +983,7 @@ namespace OpenSim.Region.RegionCombinerModule
return true; return true;
} }
} }
oborder = null; oborder = null;
return false; return false;
} }
@ -992,6 +993,9 @@ namespace OpenSim.Region.RegionCombinerModule
pPosition = pPosition/(int) Constants.RegionSize; pPosition = pPosition/(int) Constants.RegionSize;
int OffsetX = (int) pPosition.X; int OffsetX = (int) pPosition.X;
int OffsetY = (int) pPosition.Y; int OffsetY = (int) pPosition.Y;
lock (m_regions)
{
foreach (RegionConnections regConn in m_regions.Values) foreach (RegionConnections regConn in m_regions.Values)
{ {
foreach (RegionData reg in regConn.ConnectedRegions) foreach (RegionData reg in regConn.ConnectedRegions)
@ -1000,6 +1004,8 @@ namespace OpenSim.Region.RegionCombinerModule
return reg; return reg;
} }
} }
}
return new RegionData(); return new RegionData();
} }
@ -1055,18 +1061,17 @@ namespace OpenSim.Region.RegionCombinerModule
} }
#region console commands #region console commands
public void FixPhantoms(string module, string[] cmdparams) public void FixPhantoms(string module, string[] cmdparams)
{ {
List<Scene> scenes = new List<Scene>(m_startingScenes.Values); List<Scene> scenes = new List<Scene>(m_startingScenes.Values);
foreach (Scene s in scenes) foreach (Scene s in scenes)
{ {
s.ForEachSOG(delegate(SceneObjectGroup e) s.ForEachSOG(so => so.AbsolutePosition = so.AbsolutePosition);
{
e.AbsolutePosition = e.AbsolutePosition;
}
);
} }
} }
#endregion #endregion
} }
} }