Add an event to the poll service manager thread to allow starting it
when needed rather than once per second. That is just too slow!avinationmerge
parent
2548d15878
commit
9a8de52940
|
@ -41,6 +41,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
|
||||
private readonly BaseHttpServer m_server;
|
||||
private static Queue m_requests = Queue.Synchronized(new Queue());
|
||||
private static ManualResetEvent m_ev = new ManualResetEvent(false);
|
||||
private uint m_WorkerThreadCount = 0;
|
||||
private Thread[] m_workerThreads;
|
||||
private PollServiceWorkerThread[] m_PollServiceWorkerThreads;
|
||||
|
@ -88,15 +89,17 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
{
|
||||
lock (m_requests)
|
||||
m_requests.Enqueue(req);
|
||||
m_ev.Set();
|
||||
}
|
||||
|
||||
public void ThreadStart()
|
||||
{
|
||||
while (m_running)
|
||||
{
|
||||
m_ev.WaitOne(1000);
|
||||
m_ev.Reset();
|
||||
Watchdog.UpdateThread();
|
||||
ProcessQueuedRequests();
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -152,4 +155,4 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
m_running = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -89,9 +89,16 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
continue;
|
||||
}
|
||||
|
||||
Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id, str.ReadToEnd());
|
||||
m_server.DoHTTPGruntWork(responsedata,
|
||||
try
|
||||
{
|
||||
Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id, str.ReadToEnd());
|
||||
m_server.DoHTTPGruntWork(responsedata,
|
||||
new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request),req.HttpContext));
|
||||
}
|
||||
catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream
|
||||
{
|
||||
// Ignore it, no need to reply
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue