aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/OdePlugin
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-11-21 20:12:04 +0000
committerJustin Clark-Casey (justincc)2011-11-21 20:12:04 +0000
commite33b0fa35bf6bef47849c82b1ef1f5f81420217e (patch)
tree13ed36acb2359d972d9877e547478d6a6cced4df /OpenSim/Region/Physics/OdePlugin
parentrename ODECharacter.AvatarGeomAndBodyCreation() -> CreateOdeStructures() to m... (diff)
downloadopensim-SC-e33b0fa35bf6bef47849c82b1ef1f5f81420217e.zip
opensim-SC-e33b0fa35bf6bef47849c82b1ef1f5f81420217e.tar.gz
opensim-SC-e33b0fa35bf6bef47849c82b1ef1f5f81420217e.tar.bz2
opensim-SC-e33b0fa35bf6bef47849c82b1ef1f5f81420217e.tar.xz
don't lock OdeScene.contacts since only ever accessed by a single thread
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdeScene.cs34
1 files changed, 24 insertions, 10 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
index b952b30..92dd2dd 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
@@ -251,10 +251,27 @@ namespace OpenSim.Region.Physics.OdePlugin
251 //private Dictionary<String, IntPtr> jointpart_name_map = new Dictionary<String,IntPtr>(); 251 //private Dictionary<String, IntPtr> jointpart_name_map = new Dictionary<String,IntPtr>();
252 private readonly Dictionary<String, List<PhysicsJoint>> joints_connecting_actor = new Dictionary<String, List<PhysicsJoint>>(); 252 private readonly Dictionary<String, List<PhysicsJoint>> joints_connecting_actor = new Dictionary<String, List<PhysicsJoint>>();
253 private d.ContactGeom[] contacts; 253 private d.ContactGeom[] contacts;
254 private readonly List<PhysicsJoint> requestedJointsToBeCreated = new List<PhysicsJoint>(); // lock only briefly. accessed by external code (to request new joints) and by OdeScene.Simulate() to move those joints into pending/active 254
255 private readonly List<PhysicsJoint> pendingJoints = new List<PhysicsJoint>(); // can lock for longer. accessed only by OdeScene. 255 /// <summary>
256 private readonly List<PhysicsJoint> activeJoints = new List<PhysicsJoint>(); // can lock for longer. accessed only by OdeScene. 256 /// Lock only briefly. accessed by external code (to request new joints) and by OdeScene.Simulate() to move those joints into pending/active
257 private readonly List<string> requestedJointsToBeDeleted = new List<string>(); // lock only briefly. accessed by external code (to request deletion of joints) and by OdeScene.Simulate() to move those joints out of pending/active 257 /// </summary>
258 private readonly List<PhysicsJoint> requestedJointsToBeCreated = new List<PhysicsJoint>();
259
260 /// <summary>
261 /// can lock for longer. accessed only by OdeScene.
262 /// </summary>
263 private readonly List<PhysicsJoint> pendingJoints = new List<PhysicsJoint>();
264
265 /// <summary>
266 /// can lock for longer. accessed only by OdeScene.
267 /// </summary>
268 private readonly List<PhysicsJoint> activeJoints = new List<PhysicsJoint>();
269
270 /// <summary>
271 /// lock only briefly. accessed by external code (to request deletion of joints) and by OdeScene.Simulate() to move those joints out of pending/active
272 /// </summary>
273 private readonly List<string> requestedJointsToBeDeleted = new List<string>();
274
258 private Object externalJointRequestsLock = new Object(); 275 private Object externalJointRequestsLock = new Object();
259 private readonly Dictionary<String, PhysicsJoint> SOPName_to_activeJoint = new Dictionary<String, PhysicsJoint>(); 276 private readonly Dictionary<String, PhysicsJoint> SOPName_to_activeJoint = new Dictionary<String, PhysicsJoint>();
260 private readonly Dictionary<String, PhysicsJoint> SOPName_to_pendingJoint = new Dictionary<String, PhysicsJoint>(); 277 private readonly Dictionary<String, PhysicsJoint> SOPName_to_pendingJoint = new Dictionary<String, PhysicsJoint>();
@@ -776,12 +793,9 @@ namespace OpenSim.Region.Physics.OdePlugin
776 if (b1 != IntPtr.Zero && b2 != IntPtr.Zero && d.AreConnectedExcluding(b1, b2, d.JointType.Contact)) 793 if (b1 != IntPtr.Zero && b2 != IntPtr.Zero && d.AreConnectedExcluding(b1, b2, d.JointType.Contact))
777 return; 794 return;
778 795
779 lock (contacts) 796 count = d.Collide(g1, g2, contacts.Length, contacts, d.ContactGeom.SizeOf);
780 { 797 if (count > contacts.Length)
781 count = d.Collide(g1, g2, contacts.Length, contacts, d.ContactGeom.SizeOf); 798 m_log.Error("[PHYSICS]: Got " + count + " contacts when we asked for a maximum of " + contacts.Length);
782 if (count > contacts.Length)
783 m_log.Error("[PHYSICS]: Got " + count + " contacts when we asked for a maximum of " + contacts.Length);
784 }
785 } 799 }
786 catch (SEHException) 800 catch (SEHException)
787 { 801 {