diff options
author | UbitUmarov | 2016-08-22 07:32:12 +0100 |
---|---|---|
committer | UbitUmarov | 2016-08-22 07:32:12 +0100 |
commit | 3abd54082f8c757bc77edfaebb37d0ff4807a095 (patch) | |
tree | 4bafdbd6f0f0b95ad4bd09660731b9392fbb0d98 /OpenSim/Region/PhysicsModules/ubOde | |
parent | locking issue (diff) | |
download | opensim-SC-3abd54082f8c757bc77edfaebb37d0ff4807a095.zip opensim-SC-3abd54082f8c757bc77edfaebb37d0ff4807a095.tar.gz opensim-SC-3abd54082f8c757bc77edfaebb37d0ff4807a095.tar.bz2 opensim-SC-3abd54082f8c757bc77edfaebb37d0ff4807a095.tar.xz |
remove unnecessary lock
Diffstat (limited to 'OpenSim/Region/PhysicsModules/ubOde')
-rw-r--r-- | OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs | 52 |
1 files changed, 21 insertions, 31 deletions
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs b/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs index c9489d2..3a5a936 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs | |||
@@ -122,8 +122,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
122 | private float m_buoyancy = 0f; | 122 | private float m_buoyancy = 0f; |
123 | 123 | ||
124 | private bool m_freemove = false; | 124 | private bool m_freemove = false; |
125 | // private CollisionLocker ode; | 125 | |
126 | |||
127 | // private string m_name = String.Empty; | 126 | // private string m_name = String.Empty; |
128 | // other filter control | 127 | // other filter control |
129 | int m_colliderfilter = 0; | 128 | int m_colliderfilter = 0; |
@@ -1571,11 +1570,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1571 | { | 1570 | { |
1572 | if (CollisionEventsThisFrame != null) | 1571 | if (CollisionEventsThisFrame != null) |
1573 | { | 1572 | { |
1574 | lock (CollisionEventsThisFrame) | 1573 | CollisionEventsThisFrame.Clear(); |
1575 | { | 1574 | CollisionEventsThisFrame = null; |
1576 | CollisionEventsThisFrame.Clear(); | ||
1577 | CollisionEventsThisFrame = null; | ||
1578 | } | ||
1579 | } | 1575 | } |
1580 | m_eventsubscription = 0; | 1576 | m_eventsubscription = 0; |
1581 | _parent_scene.RemoveCollisionEventReporting(this); | 1577 | _parent_scene.RemoveCollisionEventReporting(this); |
@@ -1585,11 +1581,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1585 | { | 1581 | { |
1586 | if (CollisionEventsThisFrame == null) | 1582 | if (CollisionEventsThisFrame == null) |
1587 | CollisionEventsThisFrame = new CollisionEventUpdate(); | 1583 | CollisionEventsThisFrame = new CollisionEventUpdate(); |
1588 | lock (CollisionEventsThisFrame) | 1584 | CollisionEventsThisFrame.AddCollider(CollidedWith, contact); |
1589 | { | 1585 | _parent_scene.AddCollisionEventReporting(this); |
1590 | CollisionEventsThisFrame.AddCollider(CollidedWith, contact); | ||
1591 | _parent_scene.AddCollisionEventReporting(this); | ||
1592 | } | ||
1593 | } | 1586 | } |
1594 | 1587 | ||
1595 | public void SendCollisions(int timestep) | 1588 | public void SendCollisions(int timestep) |
@@ -1600,28 +1593,25 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1600 | if (CollisionEventsThisFrame == null) | 1593 | if (CollisionEventsThisFrame == null) |
1601 | return; | 1594 | return; |
1602 | 1595 | ||
1603 | lock (CollisionEventsThisFrame) | 1596 | if (m_cureventsubscription < m_eventsubscription) |
1604 | { | 1597 | return; |
1605 | if (m_cureventsubscription < m_eventsubscription) | ||
1606 | return; | ||
1607 | 1598 | ||
1608 | int ncolisions = CollisionEventsThisFrame.m_objCollisionList.Count; | 1599 | int ncolisions = CollisionEventsThisFrame.m_objCollisionList.Count; |
1609 | 1600 | ||
1610 | if (!SentEmptyCollisionsEvent || ncolisions > 0) | 1601 | if (!SentEmptyCollisionsEvent || ncolisions > 0) |
1611 | { | 1602 | { |
1612 | base.SendCollisionUpdate(CollisionEventsThisFrame); | 1603 | base.SendCollisionUpdate(CollisionEventsThisFrame); |
1613 | m_cureventsubscription = 0; | 1604 | m_cureventsubscription = 0; |
1614 | 1605 | ||
1615 | if (ncolisions == 0) | 1606 | if (ncolisions == 0) |
1616 | { | 1607 | { |
1617 | SentEmptyCollisionsEvent = true; | 1608 | SentEmptyCollisionsEvent = true; |
1618 | // _parent_scene.RemoveCollisionEventReporting(this); | 1609 | // _parent_scene.RemoveCollisionEventReporting(this); |
1619 | } | 1610 | } |
1620 | else | 1611 | else |
1621 | { | 1612 | { |
1622 | SentEmptyCollisionsEvent = false; | 1613 | SentEmptyCollisionsEvent = false; |
1623 | CollisionEventsThisFrame.Clear(); | 1614 | CollisionEventsThisFrame.Clear(); |
1624 | } | ||
1625 | } | 1615 | } |
1626 | } | 1616 | } |
1627 | } | 1617 | } |