From 14f0d5e77f65e0a0a4bbdbee0d51cd85e2d74b5d Mon Sep 17 00:00:00 2001
From: Dr Scofield
Date: Tue, 19 May 2009 18:46:20 +0000
Subject: trying to fix exception with in LLPacketQueue probably caused by
 missing locks where the queue was modified.

---
 OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
index 594a943..4a94814 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs
@@ -189,7 +189,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
             }
 
             if (item.Sequence != 0)
-                contents.Add(item.Sequence);
+                lock(contents) contents.Add(item.Sequence);
 
             lock (this)
             {
@@ -241,7 +241,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
                 item.TickCount = System.Environment.TickCount;
                 if (item.Sequence == 0)
                     return item;
-                lock (contents)
+                lock(contents)
                 {
                     if (contents.Contains(item.Sequence))
                         if (contents.Remove(item.Sequence))
@@ -252,13 +252,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
 
         public void Cancel(uint sequence)
         {
-            while (contents.Remove(sequence))
+            lock(contents) while (contents.Remove(sequence))
                 ;
         }
 
         public bool Contains(uint sequence)
         {
-            return contents.Contains(sequence);
+            lock(contents) return contents.Contains(sequence);
         }
 
         public void Flush()
@@ -318,7 +318,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
                 TextureOutgoingPacketQueue.Clear();
                 AssetOutgoingPacketQueue.Clear();
                 SendQueue.Clear();
-                contents.Clear();
+                lock(contents) contents.Clear();
             }
         }
 
-- 
cgit v1.1