consolidate client view exit paths, this seems to

cause a different synchronization issue in other
shutdown routines, though I'm not sure why
This commit is contained in:
Sean Dague
2007-12-11 21:47:18 +00:00
parent d67009a78b
commit 2e38e534d9
2 changed files with 33 additions and 37 deletions

View File

@@ -44,6 +44,8 @@ namespace OpenSim.Region.ClientStack
{
public class PacketQueue
{
private bool m_enabled = true;
private BlockingQueue<QueItem> SendQueue;
private Queue<QueItem> IncomingPacketQueue;
@@ -127,8 +129,10 @@ namespace OpenSim.Region.ClientStack
public void Enqueue(QueItem item)
{
if (!m_enabled) {return;}
// We could micro lock, but that will tend to actually
// probably be worse than just synchronizing on SendQueue
lock (this) {
switch (item.throttleType)
{
@@ -209,6 +213,7 @@ namespace OpenSim.Region.ClientStack
public void Close()
{
m_enabled = false;
throttleTimer.Stop();
}
@@ -235,18 +240,6 @@ namespace OpenSim.Region.ClientStack
TextureOutgoingPacketQueue.Count > 0);
}
// Run through our wait queues and flush out allotted numbers of bytes into the process queue
// private bool ThrottlingTime()
// {
// if(DateTime.Now.Ticks > (LastThrottle + ThrottleInterval)) {
// LastThrottle = DateTime.Now.Ticks;
// return true;
// } else {
// return false;
// }
// }
public void ProcessThrottle()
{