Changed the lock object, to see if this helps at all. Also switched the order of lock and try/catch in RemoveImageFromQueue.

prioritization
Diva Canto 2009-10-05 11:01:45 -07:00
parent 2a19187e01
commit 05c1ec7faf
1 changed files with 15 additions and 11 deletions

View File

@ -88,7 +88,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
J2KImage imgrequest; J2KImage imgrequest;
// Do a linear search for this texture download // Do a linear search for this texture download
lock (m_priorityQueue) lock (m_syncRoot)
m_priorityQueue.Find(delegate(J2KImage img) { return img.TextureID == newRequest.RequestedAssetID; }, out imgrequest); m_priorityQueue.Find(delegate(J2KImage img) { return img.TextureID == newRequest.RequestedAssetID; }, out imgrequest);
if (imgrequest != null) if (imgrequest != null)
@ -99,7 +99,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
try try
{ {
lock (m_priorityQueue) lock (m_syncRoot)
m_priorityQueue.Delete(imgrequest.PriorityQueueHandle); m_priorityQueue.Delete(imgrequest.PriorityQueueHandle);
} }
catch (Exception) { } catch (Exception) { }
@ -211,7 +211,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{ {
J2KImage image = null; J2KImage image = null;
lock (m_priorityQueue) lock (m_syncRoot)
{ {
if (m_priorityQueue.Count > 0) if (m_priorityQueue.Count > 0)
@ -230,15 +230,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{ {
image.PriorityQueueHandle = null; image.PriorityQueueHandle = null;
lock (m_priorityQueue) lock (m_syncRoot)
try
{
m_priorityQueue.Add(ref image.PriorityQueueHandle, image); m_priorityQueue.Add(ref image.PriorityQueueHandle, image);
} }
catch (Exception) { }
}
void RemoveImageFromQueue(J2KImage image) void RemoveImageFromQueue(J2KImage image)
{ {
lock (m_syncRoot)
try try
{ {
lock (m_priorityQueue)
m_priorityQueue.Delete(image.PriorityQueueHandle); m_priorityQueue.Delete(image.PriorityQueueHandle);
} }
catch (Exception) { } catch (Exception) { }
@ -246,7 +250,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
void UpdateImageInQueue(J2KImage image) void UpdateImageInQueue(J2KImage image)
{ {
lock (m_priorityQueue) lock (m_syncRoot)
{ {
try { m_priorityQueue.Replace(image.PriorityQueueHandle, image); } try { m_priorityQueue.Replace(image.PriorityQueueHandle, image); }
catch (Exception) catch (Exception)