aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-01-25 19:31:50 +0000
committerJustin Clark-Casey (justincc)2012-01-25 19:31:50 +0000
commite20cf3789bc8bbcda86c8e9067fbe8ecdb3046ac (patch)
tree5a378b0ea1a3c52b7ec16a5be48a2400ee0defc6 /OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
parentMake errors reported by OpenSim when it halts because it can't find certain c... (diff)
downloadopensim-SC_OLD-e20cf3789bc8bbcda86c8e9067fbe8ecdb3046ac.zip
opensim-SC_OLD-e20cf3789bc8bbcda86c8e9067fbe8ecdb3046ac.tar.gz
opensim-SC_OLD-e20cf3789bc8bbcda86c8e9067fbe8ecdb3046ac.tar.bz2
opensim-SC_OLD-e20cf3789bc8bbcda86c8e9067fbe8ecdb3046ac.tar.xz
Serialize calls to ODE Collide() function across OdeScene instances to prevent ODE crashes on simulators running more than one region.
It turns out that calls to Collide() are not thread-safe even for objects in different ODE physics worlds due to ODE static caches. For simulators running multiple regions, not serializing calls from different scene loops will sooner or later cause OpenSim to crash with a native stack trace referencing OBBCollider. This affects the default OPCODE collider but not GIMPACT. However, GIMPACT fails for other reasons under some current simulator loads. ODE provides a thread local storage option, but as of ODE r1755 (and r1840) DLLs compiled with this crash OpenSim immediately.
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin/ODECharacter.cs')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODECharacter.cs3
1 files changed, 3 insertions, 0 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
index c6e8286..7c1c046 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
@@ -1048,6 +1048,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1048 CAPSULE_RADIUS = 0.01f; 1048 CAPSULE_RADIUS = 0.01f;
1049 } 1049 }
1050 1050
1051// lock (OdeScene.UniversalColliderSyncObject)
1051 Shell = d.CreateCapsule(_parent_scene.space, CAPSULE_RADIUS, CAPSULE_LENGTH); 1052 Shell = d.CreateCapsule(_parent_scene.space, CAPSULE_RADIUS, CAPSULE_LENGTH);
1052 1053
1053 d.GeomSetCategoryBits(Shell, (int)m_collisionCategories); 1054 d.GeomSetCategoryBits(Shell, (int)m_collisionCategories);
@@ -1179,7 +1180,9 @@ namespace OpenSim.Region.Physics.OdePlugin
1179 1180
1180 if (Shell != IntPtr.Zero) 1181 if (Shell != IntPtr.Zero)
1181 { 1182 {
1183// lock (OdeScene.UniversalColliderSyncObject)
1182 d.GeomDestroy(Shell); 1184 d.GeomDestroy(Shell);
1185
1183 _parent_scene.geom_name_map.Remove(Shell); 1186 _parent_scene.geom_name_map.Remove(Shell);
1184 _parent_scene.actor_name_map.Remove(Shell); 1187 _parent_scene.actor_name_map.Remove(Shell);
1185 1188