remove unnecessary OdeScene._activeprims locking. Code is single-threaded

0.7.2-post-fixes
Justin Clark-Casey (justincc) 2011-11-21 21:15:15 +00:00
parent bba4577d88
commit 1edfe05c16
1 changed files with 48 additions and 55 deletions

View File

@ -194,7 +194,14 @@ namespace OpenSim.Region.Physics.OdePlugin
/// </summary>
private readonly HashSet<OdeCharacter> _characters = new HashSet<OdeCharacter>();
/// <summary>
/// Prims in the physics scene.
/// </summary>
private readonly HashSet<OdePrim> _prims = new HashSet<OdePrim>();
/// <summary>
/// Prims in the physics scene that are subject to physics, not just collisions.
/// </summary>
private readonly HashSet<OdePrim> _activeprims = new HashSet<OdePrim>();
/// <summary>
@ -1562,8 +1569,6 @@ namespace OpenSim.Region.Physics.OdePlugin
//}
}
lock (_activeprims)
{
List<OdePrim> removeprims = null;
foreach (OdePrim chr in _activeprims)
{
@ -1603,7 +1608,6 @@ namespace OpenSim.Region.Physics.OdePlugin
}
}
}
}
#endregion
@ -1770,14 +1774,11 @@ namespace OpenSim.Region.Physics.OdePlugin
internal void ActivatePrim(OdePrim prim)
{
// adds active prim.. (ones that should be iterated over in collisions_optimized
lock (_activeprims)
{
if (!_activeprims.Contains(prim))
_activeprims.Add(prim);
//else
// m_log.Warn("[PHYSICS]: Double Entry in _activeprims detected, potential crash immenent");
}
}
public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
Vector3 size, Quaternion rotation, bool isPhysical, uint localid)
@ -2152,7 +2153,6 @@ namespace OpenSim.Region.Physics.OdePlugin
/// <param name="prim"></param>
internal void DeactivatePrim(OdePrim prim)
{
lock (_activeprims)
_activeprims.Remove(prim);
}
@ -2804,14 +2804,11 @@ Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name);
}
// Move other active objects
lock (_activeprims)
{
foreach (OdePrim prim in _activeprims)
{
prim.m_collisionscore = 0;
prim.Move(timeStep);
}
}
//if ((framecount % m_randomizeWater) == 0)
// randomizeWater(waterlevel);
@ -2882,10 +2879,8 @@ Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name);
defects.Clear();
}
lock (_activeprims)
{
//if (timeStep < 0.2f)
{
foreach (OdePrim prim in _activeprims)
{
if (prim.IsPhysical && (d.BodyIsEnabled(prim.Body) || !prim._zeroFlag))
@ -2896,8 +2891,6 @@ Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name);
SimulateActorPendingJoints(prim);
}
}
}
}
//DumpJointInfo();