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;
@ -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;
@ -1452,12 +1451,15 @@ namespace OpenSim.Region.PhysicsModule.ubOde
if (item.actor != null) if (item.actor != null)
{ {
try try
{
lock (SimulationLock)
{ {
if (item.actor is OdeCharacter) if (item.actor is OdeCharacter)
((OdeCharacter)item.actor).DoAChange(item.what, item.arg); ((OdeCharacter)item.actor).DoAChange(item.what, item.arg);
else if (((OdePrim)item.actor).DoAChange(item.what, item.arg)) else if (((OdePrim)item.actor).DoAChange(item.what, item.arg))
RemovePrimThreadLocked((OdePrim)item.actor); RemovePrimThreadLocked((OdePrim)item.actor);
} }
}
catch catch
{ {
m_log.WarnFormat("[PHYSICS]: Operation failed for a actor {0} {1}", m_log.WarnFormat("[PHYSICS]: Operation failed for a actor {0} {1}",
@ -1545,12 +1547,15 @@ namespace OpenSim.Region.PhysicsModule.ubOde
if (item.actor != null) if (item.actor != null)
{ {
try try
{
lock (SimulationLock)
{ {
if (item.actor is OdeCharacter) if (item.actor is OdeCharacter)
((OdeCharacter)item.actor).DoAChange(item.what, item.arg); ((OdeCharacter)item.actor).DoAChange(item.what, item.arg);
else if (((OdePrim)item.actor).DoAChange(item.what, item.arg)) else if (((OdePrim)item.actor).DoAChange(item.what, item.arg))
RemovePrimThreadLocked((OdePrim)item.actor); RemovePrimThreadLocked((OdePrim)item.actor);
} }
}
catch catch
{ {
m_log.WarnFormat("[PHYSICS]: doChange failed for a actor {0} {1}", m_log.WarnFormat("[PHYSICS]: doChange failed for a actor {0} {1}",
@ -1601,17 +1606,19 @@ namespace OpenSim.Region.PhysicsModule.ubOde
aprim.Move(); aprim.Move();
} }
} }
// moveTime += Util.GetTimeStampMS() - tmpTime; // moveTime += Util.GetTimeStampMS() - tmpTime;
// tmpTime = Util.GetTimeStampMS();
// tmpTime = Util.GetTimeStampMS(); lock (SimulationLock)
{
m_rayCastManager.ProcessQueuedRequests(); m_rayCastManager.ProcessQueuedRequests();
// rayTime += Util.GetTimeStampMS() - tmpTime; // rayTime += Util.GetTimeStampMS() - tmpTime;
// tmpTime = Util.GetTimeStampMS(); // tmpTime = Util.GetTimeStampMS();
collision_optimized(); collision_optimized();
// collisionTime += Util.GetTimeStampMS() - tmpTime; }
// collisionTime += Util.GetTimeStampMS() - tmpTime;
// tmpTime = Util.GetTimeStampMS(); // 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();
lock (SimulationLock)
{
SafeNativeMethods.WorldQuickStep(world, ODE_STEPSIZE); SafeNativeMethods.WorldQuickStep(world, ODE_STEPSIZE);
SafeNativeMethods.JointGroupEmpty(contactgroup); 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