well.. put the ode locks back, for now

0.9.1.0-post-fixes
UbitUmarov 2019-01-21 08:34:19 +00:00
parent d7d5f9f775
commit 44d6746f40
2 changed files with 39 additions and 29 deletions

View File

@ -124,8 +124,8 @@ namespace OpenSim.Region.PhysicsModule.ODE
/// /lib/x86_64-linux-gnu/libpthread.so.0(+0xfc60) [0x7f03c9849c60] /// /lib/x86_64-linux-gnu/libpthread.so.0(+0xfc60) [0x7f03c9849c60]
/// .../opensim/bin/libode-x86_64.so(_Z12dCollideCCTLP6dxGeomS0_iP12dContactGeomi+0x92) [0x7f03b44bcf82] /// .../opensim/bin/libode-x86_64.so(_Z12dCollideCCTLP6dxGeomS0_iP12dContactGeomi+0x92) [0x7f03b44bcf82]
/// </remarks> /// </remarks>
// internal static Object UniversalColliderSyncObject = new Object(); internal static object UniversalColliderSyncObject = new object();
internal static Object SimulationLock = new Object(); internal static object SimulationLock = new object();
/// <summary> /// <summary>
/// Is stats collecting enabled for this ODE scene? /// Is stats collecting enabled for this ODE scene?
@ -880,7 +880,7 @@ namespace OpenSim.Region.PhysicsModule.ODE
{ {
int count; int count;
// lock (OdeScene.UniversalColliderSyncObject) lock (OdeScene.UniversalColliderSyncObject)
{ {
// We do this inside the lock so that we don't count any delay in acquiring it // We do this inside the lock so that we don't count any delay in acquiring it
if (CollectStats) if (CollectStats)
@ -2869,7 +2869,7 @@ namespace OpenSim.Region.PhysicsModule.ODE
tempTick = tempTick2; tempTick = tempTick2;
} }
// lock(SimulationLock) lock(SimulationLock)
SafeNativeMethods.WorldQuickStep(world, ODE_STEPSIZE); SafeNativeMethods.WorldQuickStep(world, ODE_STEPSIZE);
if (CollectStats) if (CollectStats)

View File

@ -282,7 +282,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
public IntPtr GroundSpace; // space for ground public IntPtr GroundSpace; // space for ground
public object OdeLock = new object(); public object OdeLock = new object();
// public static object SimulationLock = new object(); public static object SimulationLock = new object();
public IMesher mesher; public IMesher mesher;
@ -1134,7 +1134,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
public override PhysicsActor AddAvatar(uint localID, string avName, Vector3 position, Vector3 size, float feetOffset, bool isFlying) public override PhysicsActor AddAvatar(uint localID, string avName, Vector3 position, Vector3 size, float feetOffset, bool isFlying)
{ {
OdeCharacter newAv = new OdeCharacter(localID, avName, this, position, OdeCharacter newAv = new OdeCharacter(localID, avName, this, position,
size, feetOffset, avDensity, avMovementDivisorWalk, avMovementDivisorRun); size, feetOffset, avDensity, avMovementDivisorWalk, avMovementDivisorRun);
newAv.Flying = isFlying; newAv.Flying = isFlying;
newAv.MinimumGroundFlightOffset = minimumGroundFlightOffset; newAv.MinimumGroundFlightOffset = minimumGroundFlightOffset;
@ -1214,7 +1214,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde
OdePrim newPrim; OdePrim newPrim;
lock (OdeLock) lock (OdeLock)
{ {
newPrim = new OdePrim(name, this, position, size, rotation, pbs, isphysical, isPhantom, shapeType, localID); newPrim = new OdePrim(name, this, position, size, rotation, pbs, isphysical, isPhantom, shapeType, localID);
} }
return newPrim; return newPrim;
@ -1453,10 +1452,13 @@ namespace OpenSim.Region.PhysicsModule.ubOde
{ {
try try
{ {
if (item.actor is OdeCharacter) lock (SimulationLock)
((OdeCharacter)item.actor).DoAChange(item.what, item.arg); {
else if (((OdePrim)item.actor).DoAChange(item.what, item.arg)) if (item.actor is OdeCharacter)
RemovePrimThreadLocked((OdePrim)item.actor); ((OdeCharacter)item.actor).DoAChange(item.what, item.arg);
else if (((OdePrim)item.actor).DoAChange(item.what, item.arg))
RemovePrimThreadLocked((OdePrim)item.actor);
}
} }
catch catch
{ {
@ -1546,10 +1548,13 @@ namespace OpenSim.Region.PhysicsModule.ubOde
{ {
try try
{ {
if (item.actor is OdeCharacter) lock (SimulationLock)
((OdeCharacter)item.actor).DoAChange(item.what, item.arg); {
else if (((OdePrim)item.actor).DoAChange(item.what, item.arg)) if (item.actor is OdeCharacter)
RemovePrimThreadLocked((OdePrim)item.actor); ((OdeCharacter)item.actor).DoAChange(item.what, item.arg);
else if (((OdePrim)item.actor).DoAChange(item.what, item.arg))
RemovePrimThreadLocked((OdePrim)item.actor);
}
} }
catch catch
{ {
@ -1601,17 +1606,19 @@ namespace OpenSim.Region.PhysicsModule.ubOde
aprim.Move(); aprim.Move();
} }
} }
// moveTime += Util.GetTimeStampMS() - tmpTime; // moveTime += Util.GetTimeStampMS() - tmpTime;
// tmpTime = Util.GetTimeStampMS();
lock (SimulationLock)
{
m_rayCastManager.ProcessQueuedRequests();
// rayTime += Util.GetTimeStampMS() - tmpTime;
// tmpTime = Util.GetTimeStampMS(); // tmpTime = Util.GetTimeStampMS();
m_rayCastManager.ProcessQueuedRequests(); collision_optimized();
// rayTime += Util.GetTimeStampMS() - tmpTime; }
// collisionTime += Util.GetTimeStampMS() - tmpTime;
// tmpTime = Util.GetTimeStampMS(); // tmpTime = Util.GetTimeStampMS();
collision_optimized();
// collisionTime += Util.GetTimeStampMS() - tmpTime;
// tmpTime = Util.GetTimeStampMS();
lock(_collisionEventPrimRemove) lock(_collisionEventPrimRemove)
{ {
foreach (PhysicsActor obj in _collisionEventPrimRemove) foreach (PhysicsActor obj in _collisionEventPrimRemove)
@ -1650,13 +1657,16 @@ namespace OpenSim.Region.PhysicsModule.ubOde
foreach(OdePrim prm in sleepers) foreach(OdePrim prm in sleepers)
prm.SleeperAddCollisionEvents(); prm.SleeperAddCollisionEvents();
sleepers.Clear(); sleepers.Clear();
// collisonRepo += Util.GetTimeStampMS() - tmpTime; // collisonRepo += Util.GetTimeStampMS() - tmpTime;
// do a ode simulation step // do a ode simulation step
// tmpTime = Util.GetTimeStampMS(); // tmpTime = Util.GetTimeStampMS();
SafeNativeMethods.WorldQuickStep(world, ODE_STEPSIZE); lock (SimulationLock)
SafeNativeMethods.JointGroupEmpty(contactgroup); {
SafeNativeMethods.WorldQuickStep(world, ODE_STEPSIZE);
SafeNativeMethods.JointGroupEmpty(contactgroup);
}
// qstepTIme += Util.GetTimeStampMS() - tmpTime; // qstepTIme += Util.GetTimeStampMS() - tmpTime;
// update managed ideia of physical data and do updates to core // update managed ideia of physical data and do updates to core