diff options
author | Robert Adams | 2014-06-20 21:42:08 -0700 |
---|---|---|
committer | Robert Adams | 2014-06-20 21:42:08 -0700 |
commit | 481b7c71c34167e903b8e0d65bc8932076929675 (patch) | |
tree | 4231a260d335747ffd8a5ef04d84461ec9175c4e /OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |
parent | Improved line map heuristics. (diff) | |
download | opensim-SC_OLD-481b7c71c34167e903b8e0d65bc8932076929675.zip opensim-SC_OLD-481b7c71c34167e903b8e0d65bc8932076929675.tar.gz opensim-SC_OLD-481b7c71c34167e903b8e0d65bc8932076929675.tar.bz2 opensim-SC_OLD-481b7c71c34167e903b8e0d65bc8932076929675.tar.xz |
BulletSim: add some locking for collision lists to prevent collsions
from locking up when running BulletSim on a separate thread.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSScene.cs')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index 23bada9..17d26a9 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |||
@@ -705,7 +705,10 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
705 | // this is is under UpdateLock. | 705 | // this is is under UpdateLock. |
706 | public void PostUpdate(BSPhysObject updatee) | 706 | public void PostUpdate(BSPhysObject updatee) |
707 | { | 707 | { |
708 | ObjectsWithUpdates.Add(updatee); | 708 | lock (UpdateLock) |
709 | { | ||
710 | ObjectsWithUpdates.Add(updatee); | ||
711 | } | ||
709 | } | 712 | } |
710 | 713 | ||
711 | // The simulator thinks it is physics time so return all the collisions and position | 714 | // The simulator thinks it is physics time so return all the collisions and position |
@@ -803,7 +806,10 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
803 | if (collider.Collide(collidingWith, collidee, collidePoint, collideNormal, penetration)) | 806 | if (collider.Collide(collidingWith, collidee, collidePoint, collideNormal, penetration)) |
804 | { | 807 | { |
805 | // If a collision was 'good', remember to send it to the simulator | 808 | // If a collision was 'good', remember to send it to the simulator |
806 | ObjectsWithCollisions.Add(collider); | 809 | lock (CollisionLock) |
810 | { | ||
811 | ObjectsWithCollisions.Add(collider); | ||
812 | } | ||
807 | } | 813 | } |
808 | } | 814 | } |
809 | 815 | ||