diff options
author | Justin Clark-Casey (justincc) | 2012-05-17 23:59:43 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-05-17 23:59:43 +0100 |
commit | b18c8c8e78172abebb82491700a0b5f9f40c1d66 (patch) | |
tree | 2fc383031cddef726092a2c69490bfa89cf06a08 /OpenSim/Region | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-b18c8c8e78172abebb82491700a0b5f9f40c1d66.zip opensim-SC-b18c8c8e78172abebb82491700a0b5f9f40c1d66.tar.gz opensim-SC-b18c8c8e78172abebb82491700a0b5f9f40c1d66.tar.bz2 opensim-SC-b18c8c8e78172abebb82491700a0b5f9f40c1d66.tar.xz |
Don't eagerly clear frame collision events when physics actors subscribe and unsubscribe from collisions, in order to avoid a race condition.
Since this is done directly from ScenePresence, it can lead to a race condition with the simulator loop.
There's no real point doing it anyway since the clear will be done very shortly afterwards by the simulate loop and either there are no events (for a new avatar) or events don't matter (for a departing avatar).
This matches existing behaviour in OdePrim
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 8397eb4..1b1c44a 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | |||
@@ -1261,14 +1261,20 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1261 | { | 1261 | { |
1262 | m_requestedUpdateFrequency = ms; | 1262 | m_requestedUpdateFrequency = ms; |
1263 | m_eventsubscription = ms; | 1263 | m_eventsubscription = ms; |
1264 | CollisionEventsThisFrame.Clear(); | 1264 | |
1265 | // Don't clear collision event reporting here. This is called directly from scene code and so can lead | ||
1266 | // to a race condition with the simulate loop | ||
1267 | |||
1265 | _parent_scene.AddCollisionEventReporting(this); | 1268 | _parent_scene.AddCollisionEventReporting(this); |
1266 | } | 1269 | } |
1267 | 1270 | ||
1268 | public override void UnSubscribeEvents() | 1271 | public override void UnSubscribeEvents() |
1269 | { | 1272 | { |
1270 | CollisionEventsThisFrame.Clear(); | 1273 | CollisionEventsThisFrame.Clear(); |
1271 | _parent_scene.RemoveCollisionEventReporting(this); | 1274 | |
1275 | // Don't clear collision event reporting here. This is called directly from scene code and so can lead | ||
1276 | // to a race condition with the simulate loop | ||
1277 | |||
1272 | m_requestedUpdateFrequency = 0; | 1278 | m_requestedUpdateFrequency = 0; |
1273 | m_eventsubscription = 0; | 1279 | m_eventsubscription = 0; |
1274 | } | 1280 | } |