From 1d4cd76e8a8c64da71fc384ff9c654d7f4f849c1 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 18 Oct 2011 21:03:41 +0100 Subject: Don't bother taking OdeLock during OdeScene construction, since there can be no contention until the object is constructed. --- OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 29 +++++++++++++--------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index 9b503fc..67ed66e 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs @@ -279,7 +279,7 @@ namespace OpenSim.Region.Physics.OdePlugin /// /// Used to lock the entire physics scene. Locked during the main part of Simulate() /// - public Object OdeLock; + internal Object OdeLock = new Object(); public IMesher mesher; @@ -315,27 +315,24 @@ namespace OpenSim.Region.Physics.OdePlugin m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType.ToString() + "." + sceneIdentifier); - OdeLock = new Object(); nearCallback = near; triCallback = TriCallback; triArrayCallback = TriArrayCallback; m_rayCastManager = new ODERayCastRequestManager(this); - lock (OdeLock) - { - // Create the world and the first space - world = d.WorldCreate(); - space = d.HashSpaceCreate(IntPtr.Zero); - contactgroup = d.JointGroupCreate(0); - //contactgroup + // Create the world and the first space + world = d.WorldCreate(); + space = d.HashSpaceCreate(IntPtr.Zero); - d.WorldSetAutoDisableFlag(world, false); - #if USE_DRAWSTUFF - - Thread viewthread = new Thread(new ParameterizedThreadStart(startvisualization)); - viewthread.Start(); - #endif - } + contactgroup = d.JointGroupCreate(0); + //contactgroup + + d.WorldSetAutoDisableFlag(world, false); + #if USE_DRAWSTUFF + + Thread viewthread = new Thread(new ParameterizedThreadStart(startvisualization)); + viewthread.Start(); + #endif _watermap = new float[258 * 258]; -- cgit v1.1