mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 04:05:42 +08:00
Improve consistency of locking for SOG.m_parts in order to avoid race conditions in linking and unlinking
This commit is contained in:
@@ -156,21 +156,29 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
// We also need to check the children of this prim as they
|
||||
// can be selected as well and send property information
|
||||
bool foundPrim = false;
|
||||
foreach (KeyValuePair<UUID, SceneObjectPart> child in ((SceneObjectGroup) ent).Children)
|
||||
{
|
||||
if (child.Value.LocalId == primLocalID)
|
||||
{
|
||||
child.Value.GetProperties(remoteClient);
|
||||
foundPrim = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (foundPrim) break;
|
||||
else
|
||||
{
|
||||
// We also need to check the children of this prim as they
|
||||
// can be selected as well and send property information
|
||||
bool foundPrim = false;
|
||||
|
||||
SceneObjectGroup sog = ent as SceneObjectGroup;
|
||||
|
||||
lock (sog.Children)
|
||||
{
|
||||
foreach (KeyValuePair<UUID, SceneObjectPart> child in (sog.Children))
|
||||
{
|
||||
if (child.Value.LocalId == primLocalID)
|
||||
{
|
||||
child.Value.GetProperties(remoteClient);
|
||||
foundPrim = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (foundPrim)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user