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