Ooops fix bad locking
parent
f474c10f71
commit
27f5248d9f
|
@ -97,6 +97,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// conditions can occur.
|
/// conditions can occur.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
private Object m_updateLock = new Object();
|
private Object m_updateLock = new Object();
|
||||||
|
private Object m_linkLock = new Object();
|
||||||
private System.Threading.ReaderWriterLockSlim m_scenePresencesLock;
|
private System.Threading.ReaderWriterLockSlim m_scenePresencesLock;
|
||||||
private System.Threading.ReaderWriterLockSlim m_scenePartsLock;
|
private System.Threading.ReaderWriterLockSlim m_scenePartsLock;
|
||||||
|
|
||||||
|
@ -633,10 +634,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// Process all pending updates
|
/// Process all pending updates
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected internal void UpdateObjectGroups()
|
protected internal void UpdateObjectGroups()
|
||||||
{
|
|
||||||
if (!Monitor.TryEnter(m_updateLock))
|
|
||||||
return;
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
Dictionary<UUID, SceneObjectGroup> updates;
|
Dictionary<UUID, SceneObjectGroup> updates;
|
||||||
// Get the current list of updates and clear the list before iterating
|
// Get the current list of updates and clear the list before iterating
|
||||||
|
@ -665,11 +662,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
updates = null;
|
updates = null;
|
||||||
}
|
}
|
||||||
finally
|
|
||||||
{
|
|
||||||
Monitor.Exit(m_updateLock);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected internal void AddPhysicalPrim(int number)
|
protected internal void AddPhysicalPrim(int number)
|
||||||
{
|
{
|
||||||
|
@ -1704,11 +1696,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
protected internal void UpdatePrimFlags(
|
protected internal void UpdatePrimFlags(
|
||||||
uint localID, bool UsePhysics, bool SetTemporary, bool SetPhantom, ExtraPhysicsData PhysData, IClientAPI remoteClient)
|
uint localID, bool UsePhysics, bool SetTemporary, bool SetPhantom, ExtraPhysicsData PhysData, IClientAPI remoteClient)
|
||||||
{
|
{
|
||||||
SceneObjectGroup group = GetGroupByPrim(localID);
|
SceneObjectPart part = GetSceneObjectPart(localID);
|
||||||
if (group != null)
|
if(part == null)
|
||||||
{
|
return;
|
||||||
if (m_parentScene.Permissions.CanEditObject(group, remoteClient))
|
SceneObjectGroup group = part.ParentGroup;
|
||||||
{
|
if(group == null || group.IsDeleted)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!m_parentScene.Permissions.CanEditObject(group, remoteClient))
|
||||||
|
return;
|
||||||
|
|
||||||
// VolumeDetect can't be set via UI and will always be off when a change is made there
|
// VolumeDetect can't be set via UI and will always be off when a change is made there
|
||||||
// now only change volume dtc if phantom off
|
// now only change volume dtc if phantom off
|
||||||
|
|
||||||
|
@ -1724,15 +1721,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
group.UpdateFlags(UsePhysics, SetTemporary, SetPhantom, vdtc);
|
group.UpdateFlags(UsePhysics, SetTemporary, SetPhantom, vdtc);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
SceneObjectPart part = group.GetPart(localID);
|
|
||||||
if (part != null)
|
|
||||||
{
|
{
|
||||||
part.UpdateExtraPhysics(PhysData);
|
part.UpdateExtraPhysics(PhysData);
|
||||||
if (remoteClient != null)
|
if (remoteClient != null)
|
||||||
remoteClient.SendPartPhysicsProprieties(part);
|
remoteClient.SendPartPhysicsProprieties(part);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (wantedPhys != group.UsesPhysics && remoteClient != null)
|
if (wantedPhys != group.UsesPhysics && remoteClient != null)
|
||||||
{
|
{
|
||||||
|
@ -1744,8 +1737,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
group.RootPart.ScheduleFullUpdate();
|
group.RootPart.ScheduleFullUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
@ -1899,7 +1890,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (parentGroup.OwnerID == parentGroup.GroupID)
|
if (parentGroup.OwnerID == parentGroup.GroupID)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Monitor.Enter(m_updateLock);
|
Monitor.Enter(m_linkLock);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -1962,7 +1953,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
parentGroup.HasGroupChanged = true;
|
parentGroup.HasGroupChanged = true;
|
||||||
parentGroup.ProcessBackup(m_parentScene.SimulationDataService, true);
|
parentGroup.ProcessBackup(m_parentScene.SimulationDataService, true);
|
||||||
parentGroup.ScheduleGroupForFullAnimUpdate();
|
parentGroup.ScheduleGroupForFullAnimUpdate();
|
||||||
Monitor.Exit(m_updateLock);
|
Monitor.Exit(m_linkLock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1972,7 +1963,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <param name="prims"></param>
|
/// <param name="prims"></param>
|
||||||
protected internal void DelinkObjects(List<SceneObjectPart> prims)
|
protected internal void DelinkObjects(List<SceneObjectPart> prims)
|
||||||
{
|
{
|
||||||
Monitor.Enter(m_updateLock);
|
Monitor.Enter(m_linkLock);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
List<SceneObjectPart> childParts = new List<SceneObjectPart>();
|
List<SceneObjectPart> childParts = new List<SceneObjectPart>();
|
||||||
|
@ -2090,7 +2081,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
Monitor.Exit(m_updateLock);
|
Monitor.Exit(m_linkLock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue