diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Types/UpdateQueue.cs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/OpenSim/Region/Environment/Types/UpdateQueue.cs b/OpenSim/Region/Environment/Types/UpdateQueue.cs index ce0927c..391c50c 100644 --- a/OpenSim/Region/Environment/Types/UpdateQueue.cs +++ b/OpenSim/Region/Environment/Types/UpdateQueue.cs | |||
@@ -43,6 +43,8 @@ namespace OpenSim.Region.Environment.Types | |||
43 | 43 | ||
44 | private List<LLUUID> m_ids; | 44 | private List<LLUUID> m_ids; |
45 | 45 | ||
46 | private object m_syncObject = new object(); | ||
47 | |||
46 | public int Count | 48 | public int Count |
47 | { | 49 | { |
48 | get { return m_queue.Count; } | 50 | get { return m_queue.Count; } |
@@ -53,21 +55,19 @@ namespace OpenSim.Region.Environment.Types | |||
53 | m_queue = new Queue<SceneObjectPart>(); | 55 | m_queue = new Queue<SceneObjectPart>(); |
54 | m_ids = new List<LLUUID>(); | 56 | m_ids = new List<LLUUID>(); |
55 | } | 57 | } |
58 | |||
56 | public void Clear() | 59 | public void Clear() |
57 | { | 60 | { |
58 | lock (m_ids) | 61 | lock (m_syncObject) |
59 | { | 62 | { |
60 | m_ids.Clear(); | 63 | m_ids.Clear(); |
61 | } | ||
62 | lock (m_queue) | ||
63 | { | ||
64 | m_queue.Clear(); | 64 | m_queue.Clear(); |
65 | } | 65 | } |
66 | } | 66 | } |
67 | 67 | ||
68 | public void Enqueue(SceneObjectPart part) | 68 | public void Enqueue(SceneObjectPart part) |
69 | { | 69 | { |
70 | lock (m_ids) | 70 | lock (m_syncObject) |
71 | { | 71 | { |
72 | if (!m_ids.Contains(part.UUID)) | 72 | if (!m_ids.Contains(part.UUID)) |
73 | { | 73 | { |
@@ -80,11 +80,11 @@ namespace OpenSim.Region.Environment.Types | |||
80 | public SceneObjectPart Dequeue() | 80 | public SceneObjectPart Dequeue() |
81 | { | 81 | { |
82 | SceneObjectPart part = null; | 82 | SceneObjectPart part = null; |
83 | if (m_queue.Count > 0) | 83 | lock (m_syncObject) |
84 | { | 84 | { |
85 | part = m_queue.Dequeue(); | 85 | if (m_queue.Count > 0) |
86 | lock (m_ids) | ||
87 | { | 86 | { |
87 | part = m_queue.Dequeue(); | ||
88 | m_ids.Remove(part.UUID); | 88 | m_ids.Remove(part.UUID); |
89 | } | 89 | } |
90 | } | 90 | } |