* Locking on local scope variable does not make sense - every thread will have its own
* Locking on value, then changing it does not make sense - lock will happen on old reference * Taking a local copy of the shared resource then locking on the copy does not make sense - lock will happen on copyafrisby
parent
b0c5693c02
commit
d05b121dff
|
@ -250,29 +250,23 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
public void InformNeighborsThatRegionisUp(RegionInfo region)
|
||||
{
|
||||
//MainLog.Instance.Verbose("INTER", debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName);
|
||||
List<SimpleRegionInfo> neighbours = new List<SimpleRegionInfo>();
|
||||
|
||||
lock (neighbours)
|
||||
{
|
||||
neighbours = m_commsProvider.GridService.RequestNeighbours(m_regionInfo.RegionLocX, m_regionInfo.RegionLocY);
|
||||
List<SimpleRegionInfo> neighbours = m_commsProvider.GridService.RequestNeighbours(m_regionInfo.RegionLocX, m_regionInfo.RegionLocY);
|
||||
if (neighbours != null)
|
||||
{
|
||||
for (int i = 0; i < neighbours.Count; i++)
|
||||
{
|
||||
|
||||
InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync;
|
||||
// race condition! Arg! I hate race conditions.
|
||||
lock (d)
|
||||
{
|
||||
|
||||
d.BeginInvoke(region, neighbours[i].RegionHandle,
|
||||
InformNeighborsThatRegionisUpCompleted,
|
||||
d);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//bool val = m_commsProvider.InterRegion.RegionUp(new SearializableRegionInfo(region));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in New Issue