ubOde: add threading related calls new ode.dll may need. Hope this doesn't break with current linux ode library

LSLKeyTest
UbitUmarov 2015-11-20 00:37:41 +00:00
parent 0c93159297
commit 98a00cbce5
2 changed files with 23 additions and 4 deletions

View File

@ -466,6 +466,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde
{
lock (_parent_scene.OdeLock)
{
d.AllocateODEDataForThread(0);
d.Vector3 dtmp;
if (!childPrim && Body != IntPtr.Zero)
{
@ -892,6 +894,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde
_velocity.Y = 0;
_velocity.Z = 0;
d.AllocateODEDataForThread(0);
m_lastVelocity = _velocity;
if (m_vehicle != null && m_vehicle.Type != Vehicle.TYPE_NONE)
m_vehicle.Stop();

View File

@ -366,7 +366,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde
/// </summary>
private void Initialization()
{
// checkThread();
d.AllocateODEDataForThread(~0U);
SimulationLock = new Object();
nearCallback = near;
@ -1290,8 +1291,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde
public override void RemoveAvatar(PhysicsActor actor)
{
//m_log.Debug("[PHYSICS]:ODELOCK");
lock (OdeLock)
{
d.AllocateODEDataForThread(0);
((OdeCharacter) actor).Destroy();
}
}
public void addActivePrim(OdePrim activatePrim)
@ -1319,6 +1324,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
OdePrim newPrim;
lock (OdeLock)
{
newPrim = new OdePrim(name, this, position, size, rotation, pbs, isphysical, isPhantom, shapeType, localID);
lock (_prims)
_prims.Add(newPrim);
@ -1547,6 +1553,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde
return;
}
d.AllocateODEDataForThread(~0U);
ODEchangeitem item;
int donechanges = 0;
@ -1631,6 +1639,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde
int maxChangestime = (int)(reqTimeStep * 500f); // half the time
int maxLoopTime = (int)(reqTimeStep * 1200f); // 1.2 the time
d.AllocateODEDataForThread(~0U);
if (ChangesQueue.Count > 0)
{
while (ChangesQueue.Dequeue(out item))
@ -2260,6 +2270,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde
lock (OdeLock)
{
d.AllocateODEDataForThread(~0U);
IntPtr GroundGeom = IntPtr.Zero;
if (RegionTerrain.TryGetValue(pOffset, out GroundGeom))
{
@ -2450,9 +2462,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde
{
lock (OdeLock)
{
if (world == IntPtr.Zero)
return;
d.AllocateODEDataForThread(~0U);
if (m_meshWorker != null)
m_meshWorker.Stop();