diff options
author | Melanie Thielker | 2010-06-01 19:01:21 +0200 |
---|---|---|
committer | Melanie Thielker | 2010-06-01 19:01:21 +0200 |
commit | 6668c789d34bf9b068df5821973fdb75cf129b75 (patch) | |
tree | d3b7f3d19c4fcd15e253ee8998aae91333aaf014 /OpenSim | |
parent | Lock the object queue when dequeueing (diff) | |
download | opensim-SC-6668c789d34bf9b068df5821973fdb75cf129b75.zip opensim-SC-6668c789d34bf9b068df5821973fdb75cf129b75.tar.gz opensim-SC-6668c789d34bf9b068df5821973fdb75cf129b75.tar.bz2 opensim-SC-6668c789d34bf9b068df5821973fdb75cf129b75.tar.xz |
One should not lock null objects.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneViewer.cs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneViewer.cs b/OpenSim/Region/Framework/Scenes/SceneViewer.cs index 5cbd8d9..f478a4a 100644 --- a/OpenSim/Region/Framework/Scenes/SceneViewer.cs +++ b/OpenSim/Region/Framework/Scenes/SceneViewer.cs | |||
@@ -67,14 +67,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
67 | 67 | ||
68 | public void SendPrimUpdates() | 68 | public void SendPrimUpdates() |
69 | { | 69 | { |
70 | lock(m_pendingObjects) | 70 | if (m_pendingObjects == null) |
71 | { | 71 | { |
72 | if (m_pendingObjects == null) | 72 | if (!m_presence.IsChildAgent || (m_presence.Scene.m_seeIntoRegionFromNeighbor)) |
73 | { | 73 | { |
74 | if (!m_presence.IsChildAgent || (m_presence.Scene.m_seeIntoRegionFromNeighbor)) | 74 | m_pendingObjects = new Queue<SceneObjectGroup>(); |
75 | { | ||
76 | m_pendingObjects = new Queue<SceneObjectGroup>(); | ||
77 | 75 | ||
76 | lock(m_pendingObjects) | ||
77 | { | ||
78 | foreach (EntityBase e in m_presence.Scene.Entities) | 78 | foreach (EntityBase e in m_presence.Scene.Entities) |
79 | { | 79 | { |
80 | if (e != null && e is SceneObjectGroup) | 80 | if (e != null && e is SceneObjectGroup) |
@@ -82,7 +82,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
82 | } | 82 | } |
83 | } | 83 | } |
84 | } | 84 | } |
85 | } | ||
85 | 86 | ||
87 | lock(m_pendingObjects) | ||
88 | { | ||
86 | while (m_pendingObjects != null && m_pendingObjects.Count > 0) | 89 | while (m_pendingObjects != null && m_pendingObjects.Count > 0) |
87 | { | 90 | { |
88 | SceneObjectGroup g = m_pendingObjects.Dequeue(); | 91 | SceneObjectGroup g = m_pendingObjects.Dequeue(); |