ubOde: add a needed lock

melanie
UbitUmarov 2016-11-10 23:07:57 +00:00
parent 743a9d617e
commit 58b7be48a9
1 changed files with 11 additions and 5 deletions

View File

@ -1220,10 +1220,13 @@ namespace OpenSim.Region.PhysicsModule.ubOde
/// </summary>
/// <param name="obj"></param>
public void RemoveCollisionEventReporting(PhysicsActor obj)
{
lock(_collisionEventPrimRemove)
{
if (_collisionEventPrim.Contains(obj) && !_collisionEventPrimRemove.Contains(obj))
_collisionEventPrimRemove.Add(obj);
}
}
public override float TimeDilation
{
@ -1759,10 +1762,13 @@ namespace OpenSim.Region.PhysicsModule.ubOde
prm.SleeperAddCollisionEvents();
sleepers.Clear();
lock(_collisionEventPrimRemove)
{
foreach (PhysicsActor obj in _collisionEventPrimRemove)
_collisionEventPrim.Remove(obj);
_collisionEventPrimRemove.Clear();
}
// do a ode simulation step
d.WorldQuickStep(world, ODE_STEPSIZE);