aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorAdam Frisby2008-10-10 13:46:43 +0000
committerAdam Frisby2008-10-10 13:46:43 +0000
commitfa55fc89d8ab014217b58f78829cce006186b486 (patch)
treebae5423a9fd2a71ca2d4f01615b3747336f48a29 /OpenSim/Region
parent* Just some OGP maintenance. Standards adherence type stuff. (diff)
downloadopensim-SC-fa55fc89d8ab014217b58f78829cce006186b486.zip
opensim-SC-fa55fc89d8ab014217b58f78829cce006186b486.tar.gz
opensim-SC-fa55fc89d8ab014217b58f78829cce006186b486.tar.bz2
opensim-SC-fa55fc89d8ab014217b58f78829cce006186b486.tar.xz
* Fixed a potential threading issue with EventQueueGet leading to spontaneous crashes.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs17
1 files changed, 12 insertions, 5 deletions
diff --git a/OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs b/OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs
index 78e2df5..5f20dc1 100644
--- a/OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs
+++ b/OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs
@@ -132,12 +132,16 @@ namespace OpenSim.Region.Environment.Modules.Framework
132 132
133 private BlockingLLSDQueue GetQueue(UUID agentId) 133 private BlockingLLSDQueue GetQueue(UUID agentId)
134 { 134 {
135 if (!queues.ContainsKey(agentId)) 135 lock (queues)
136 { 136 {
137 m_log.DebugFormat("[EVENTQUEUE]: Adding new queue for agent {0} in region {1}", agentId, m_scene.RegionInfo.RegionName); 137 if (!queues.ContainsKey(agentId))
138 queues[agentId] = new BlockingLLSDQueue(); 138 {
139 m_log.DebugFormat("[EVENTQUEUE]: Adding new queue for agent {0} in region {1}", agentId,
140 m_scene.RegionInfo.RegionName);
141 queues[agentId] = new BlockingLLSDQueue();
142 }
143 return queues[agentId];
139 } 144 }
140 return queues[agentId];
141 } 145 }
142 146
143 147
@@ -164,7 +168,10 @@ namespace OpenSim.Region.Environment.Modules.Framework
164 168
165 private void ClientClosed(UUID AgentID) 169 private void ClientClosed(UUID AgentID)
166 { 170 {
167 queues.Remove(AgentID); 171 lock (queues)
172 {
173 queues.Remove(AgentID);
174 }
168 List<UUID> removeitems = new List<UUID>(); 175 List<UUID> removeitems = new List<UUID>();
169 lock (m_AvatarQueueUUIDMapping) 176 lock (m_AvatarQueueUUIDMapping)
170 { 177 {