forgotten locks on ubode

0.9.1.0-post-fixes
UbitUmarov 2019-01-28 03:37:54 +00:00
parent cc204a279e
commit 4c79a85621
1 changed files with 39 additions and 36 deletions

View File

@ -1180,15 +1180,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde
//m_log.Debug("[PHYSICS]:ODELOCK"); //m_log.Debug("[PHYSICS]:ODELOCK");
if (world == IntPtr.Zero) if (world == IntPtr.Zero)
return; return;
lock (SimulationLock)
lock (OdeLock) lock (OdeLock)
{ {
SafeNativeMethods.AllocateODEDataForThread(0); SafeNativeMethods.AllocateODEDataForThread(0);
((OdeCharacter) actor).Destroy(); ((OdeCharacter) actor).Destroy();
} }
} }
public void addActivePrim(OdePrim activatePrim) public void addActivePrim(OdePrim activatePrim)
{ {
// adds active prim.. // adds active prim..
@ -1510,7 +1509,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
int nodeframes = 0; int nodeframes = 0;
float fps = 0; float fps = 0;
lock(OdeLock) lock (OdeLock)
{ {
if (world == IntPtr.Zero) if (world == IntPtr.Zero)
{ {
@ -1548,9 +1547,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde
{ {
try try
{ {
lock (SimulationLock) 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);
@ -1599,17 +1598,17 @@ namespace OpenSim.Region.PhysicsModule.ubOde
} }
// Move other active objects // Move other active objects
lock (_activegroups)
{
foreach (OdePrim aprim in _activegroups)
{
aprim.Move();
}
}
// moveTime += Util.GetTimeStampMS() - tmpTime;
// tmpTime = Util.GetTimeStampMS();
lock (SimulationLock) lock (SimulationLock)
{ {
lock (_activegroups)
{
foreach (OdePrim aprim in _activegroups)
{
aprim.Move();
}
}
// moveTime += Util.GetTimeStampMS() - tmpTime;
// tmpTime = Util.GetTimeStampMS();
m_rayCastManager.ProcessQueuedRequests(); m_rayCastManager.ProcessQueuedRequests();
// rayTime += Util.GetTimeStampMS() - tmpTime; // rayTime += Util.GetTimeStampMS() - tmpTime;
@ -1667,37 +1666,41 @@ namespace OpenSim.Region.PhysicsModule.ubOde
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
/* /*
lock (_characters) lock (_characters)
{ {
foreach (OdeCharacter actor in _characters) foreach (OdeCharacter actor in _characters)
{ {
if (actor != null) if (actor != null)
{ {
if (actor.bad) if (actor.bad)
m_log.WarnFormat("[PHYSICS]: BAD Actor {0} in _characters list was not removed?", actor.m_uuid); m_log.WarnFormat("[PHYSICS]: BAD Actor {0} in _characters list was not removed?", actor.m_uuid);
actor.UpdatePositionAndVelocity(); actor.UpdatePositionAndVelocity();
} }
} }
} }
*/ */
// tmpTime = Util.GetTimeStampMS(); // tmpTime = Util.GetTimeStampMS();
lock (_activegroups) lock (SimulationLock)
{ {
lock (_activegroups)
{ {
foreach (OdePrim actor in _activegroups)
{ {
if (actor.IsPhysical) foreach (OdePrim actor in _activegroups)
{ {
actor.UpdatePositionAndVelocity(framecount); if (actor.IsPhysical)
{
actor.UpdatePositionAndVelocity(framecount);
}
} }
} }
} }
} }
// updatesTime += Util.GetTimeStampMS() - tmpTime; // updatesTime += Util.GetTimeStampMS() - tmpTime;
} }
catch (Exception e) catch (Exception e)