* Fixed a potential threading issue with EventQueueGet leading to spontaneous crashes.

0.6.0-stable
Adam Frisby 2008-10-10 13:46:43 +00:00
parent d19400db44
commit fa55fc89d8
1 changed files with 12 additions and 5 deletions

View File

@ -131,14 +131,18 @@ namespace OpenSim.Region.Environment.Modules.Framework
#endregion #endregion
private BlockingLLSDQueue GetQueue(UUID agentId) private BlockingLLSDQueue GetQueue(UUID agentId)
{
lock (queues)
{ {
if (!queues.ContainsKey(agentId)) if (!queues.ContainsKey(agentId))
{ {
m_log.DebugFormat("[EVENTQUEUE]: Adding new queue for agent {0} in region {1}", agentId, m_scene.RegionInfo.RegionName); m_log.DebugFormat("[EVENTQUEUE]: Adding new queue for agent {0} in region {1}", agentId,
m_scene.RegionInfo.RegionName);
queues[agentId] = new BlockingLLSDQueue(); queues[agentId] = new BlockingLLSDQueue();
} }
return queues[agentId]; return queues[agentId];
} }
}
#region IEventQueue Members #region IEventQueue Members
@ -163,8 +167,11 @@ namespace OpenSim.Region.Environment.Modules.Framework
} }
private void ClientClosed(UUID AgentID) private void ClientClosed(UUID AgentID)
{
lock (queues)
{ {
queues.Remove(AgentID); queues.Remove(AgentID);
}
List<UUID> removeitems = new List<UUID>(); List<UUID> removeitems = new List<UUID>();
lock (m_AvatarQueueUUIDMapping) lock (m_AvatarQueueUUIDMapping)
{ {