mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 17:32:42 +08:00
Reinstate explicit starting and stopping of PollServiceRequestManager added in 3eee991 but removed in 7c0bfca
Do not rely on destructors to stop things. These fire at unpredictable times and cause problems such as http://opensimulator.org/mantis/view.php?id=6503 and most probably http://opensimulator.org/mantis/view.php?id=6668
This commit is contained in:
@@ -66,7 +66,10 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
m_server = pSrv;
|
||||
m_WorkerThreadCount = pWorkerThreadCount;
|
||||
m_workerThreads = new Thread[m_WorkerThreadCount];
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
//startup worker threads
|
||||
for (uint i = 0; i < m_WorkerThreadCount; i++)
|
||||
{
|
||||
@@ -91,7 +94,6 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
1000 * 60 * 10);
|
||||
}
|
||||
|
||||
|
||||
private void ReQueueEvent(PollServiceHttpRequest req)
|
||||
{
|
||||
if (m_running)
|
||||
@@ -142,14 +144,14 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
}
|
||||
}
|
||||
|
||||
~PollServiceRequestManager()
|
||||
public void Stop()
|
||||
{
|
||||
m_running = false;
|
||||
// m_timeout = -10000; // cause all to expire
|
||||
Thread.Sleep(1000); // let the world move
|
||||
|
||||
foreach (Thread t in m_workerThreads)
|
||||
Watchdog.AbortThread(t.ManagedThreadId);
|
||||
Watchdog.AbortThread(t.ManagedThreadId);
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user