From 09865557650b4d1b36d8ebf292191d0feb1445fa Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 21 Oct 2018 12:13:21 +0100 Subject: [PATCH] mantis 8387: (try) avoid potencial out of order phys operations --- OpenSim/Region/PhysicsModules/BulletS/BSScene.cs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSScene.cs b/OpenSim/Region/PhysicsModules/BulletS/BSScene.cs index 163efaa8e0..8e29dd060d 100644 --- a/OpenSim/Region/PhysicsModules/BulletS/BSScene.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSScene.cs @@ -352,13 +352,9 @@ namespace OpenSim.Region.PhysicsModule.BulletS if (BSParam.UseSeparatePhysicsThread) { // The physics simulation should happen independently of the heartbeat loop - m_physicsThread - = WorkManager.StartThread( + m_physicsThread = WorkManager.StartThread( BulletSPluginPhysicsThread, - string.Format("{0} ({1})", BulletEngineName, RegionName), - ThreadPriority.Normal, - true, - true); + string.Format("{0} ({1})", BulletEngineName, RegionName)); } } @@ -1238,6 +1234,8 @@ namespace OpenSim.Region.PhysicsModule.BulletS { if (!m_initialized) return; +/* mantis 8397 ??? avoid out of order operations ??? + if (Monitor.TryEnter(PhysicsEngineLock)) { // If we can get exclusive access to the physics engine, just do the operation @@ -1246,12 +1244,13 @@ namespace OpenSim.Region.PhysicsModule.BulletS } else { +*/ // The physics engine is busy, queue the operation lock (_taintLock) { _taintOperations.Add(new TaintCallbackEntry(pOriginator, pIdent, pCallback)); } - } +// } } private void TriggerPreStepEvent(float timeStep)