trying to fix exception with in LLPacketQueue probably caused by

missing locks where the queue was modified.
0.6.6-post-fixes
Dr Scofield 2009-05-19 18:46:20 +00:00
parent 8559f9bbba
commit 14f0d5e77f
1 changed files with 5 additions and 5 deletions

View File

@ -189,7 +189,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
if (item.Sequence != 0) if (item.Sequence != 0)
contents.Add(item.Sequence); lock(contents) contents.Add(item.Sequence);
lock (this) lock (this)
{ {
@ -241,7 +241,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
item.TickCount = System.Environment.TickCount; item.TickCount = System.Environment.TickCount;
if (item.Sequence == 0) if (item.Sequence == 0)
return item; return item;
lock (contents) lock(contents)
{ {
if (contents.Contains(item.Sequence)) if (contents.Contains(item.Sequence))
if (contents.Remove(item.Sequence)) if (contents.Remove(item.Sequence))
@ -252,13 +252,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public void Cancel(uint sequence) public void Cancel(uint sequence)
{ {
while (contents.Remove(sequence)) lock(contents) while (contents.Remove(sequence))
; ;
} }
public bool Contains(uint sequence) public bool Contains(uint sequence)
{ {
return contents.Contains(sequence); lock(contents) return contents.Contains(sequence);
} }
public void Flush() public void Flush()
@ -318,7 +318,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
TextureOutgoingPacketQueue.Clear(); TextureOutgoingPacketQueue.Clear();
AssetOutgoingPacketQueue.Clear(); AssetOutgoingPacketQueue.Clear();
SendQueue.Clear(); SendQueue.Clear();
contents.Clear(); lock(contents) contents.Clear();
} }
} }