Reduced locking.

prioritization
Diva Canto 2009-10-04 14:05:58 -07:00
parent 022526661b
commit 5b19d5a7b7
1 changed files with 13 additions and 11 deletions

View File

@ -167,8 +167,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
J2KImage imagereq; J2KImage imagereq;
int numCollected = 0; int numCollected = 0;
lock (m_syncRoot) //lock (m_syncRoot)
{ //{
m_lastloopprocessed = DateTime.Now.Ticks; m_lastloopprocessed = DateTime.Now.Ticks;
// This can happen during Close() // This can happen during Close()
@ -191,7 +191,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (numCollected == count) if (numCollected == count)
break; break;
} }
} //}
return m_priorityQueue.Count > 0; return m_priorityQueue.Count > 0;
} }
@ -211,16 +211,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{ {
J2KImage image = null; J2KImage image = null;
lock (m_priorityQueue)
{
if (m_priorityQueue.Count > 0) if (m_priorityQueue.Count > 0)
{ {
try try
{ {
lock (m_priorityQueue)
image = m_priorityQueue.FindMax(); image = m_priorityQueue.FindMax();
} }
catch (Exception) { } catch (Exception) { }
} }
}
return image; return image;
} }