add a bit more pre exit cleanup
parent
2008e65695
commit
dca3a45803
|
@ -108,16 +108,16 @@ namespace OpenSim.Framework.Servers
|
|||
|
||||
protected override void ShutdownSpecific()
|
||||
{
|
||||
|
||||
|
||||
Watchdog.Enabled = false;
|
||||
base.ShutdownSpecific();
|
||||
|
||||
|
||||
MainServer.Stop();
|
||||
|
||||
Thread.Sleep(5000);
|
||||
|
||||
Util.StopThreadPool();
|
||||
WorkManager.Stop();
|
||||
|
||||
Thread.Sleep(1000);
|
||||
RemovePIDFile();
|
||||
m_log.Info("[SHUTDOWN]: Shutdown processing on main thread complete. Exiting...");
|
||||
|
||||
|
|
|
@ -2852,6 +2852,16 @@ namespace OpenSim.Framework
|
|||
return stpi;
|
||||
}
|
||||
|
||||
public static void StopThreadPool()
|
||||
{
|
||||
if (m_ThreadPool == null)
|
||||
return;
|
||||
SmartThreadPool pool = m_ThreadPool;
|
||||
m_ThreadPool = null;
|
||||
|
||||
try { pool.Shutdown(); } catch {}
|
||||
}
|
||||
|
||||
#endregion FireAndForget Threading Pattern
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -249,6 +249,9 @@ namespace OpenSim.Server.Base
|
|||
}
|
||||
}
|
||||
|
||||
MemoryWatchdog.Enabled = false;
|
||||
Watchdog.Enabled = false;
|
||||
|
||||
RemovePIDFile();
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -31,6 +31,7 @@ using System.Reflection;
|
|||
using System;
|
||||
using System.Net;
|
||||
using System.Collections.Generic;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Servers;
|
||||
using OpenSim.Framework.Servers.HttpServer;
|
||||
using OpenSim.Server.Base;
|
||||
|
@ -161,6 +162,11 @@ namespace OpenSim.Server
|
|||
|
||||
int res = m_Server.Run();
|
||||
|
||||
if(m_Server != null)
|
||||
m_Server.Shutdown();
|
||||
|
||||
Util.StopThreadPool();
|
||||
|
||||
Environment.Exit(res);
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue