diff --git a/OpenSim/Framework/Monitoring/Watchdog.cs b/OpenSim/Framework/Monitoring/Watchdog.cs
index 9cc61ee62d..8a4894eb20 100644
--- a/OpenSim/Framework/Monitoring/Watchdog.cs
+++ b/OpenSim/Framework/Monitoring/Watchdog.cs
@@ -180,6 +180,30 @@ namespace OpenSim.Framework.Monitoring
m_watchdogTimer.Elapsed += WatchdogTimerElapsed;
}
+ public static void Stop()
+ {
+ if(m_threads == null)
+ return;
+
+ lock(m_threads)
+ {
+ m_enabled = false;
+ if(m_watchdogTimer != null)
+ {
+ m_watchdogTimer.Dispose();
+ m_watchdogTimer = null;
+ }
+
+ foreach(ThreadWatchdogInfo twi in m_threads.Values)
+ {
+ Thread t = twi.Thread;
+ if(t.IsAlive)
+ t.Abort();
+ }
+ m_threads.Clear();
+ }
+ }
+
///
/// Add a thread to the watchdog tracker.
///
diff --git a/OpenSim/Framework/Monitoring/WorkManager.cs b/OpenSim/Framework/Monitoring/WorkManager.cs
index a3e03904eb..9d52f71f8d 100644
--- a/OpenSim/Framework/Monitoring/WorkManager.cs
+++ b/OpenSim/Framework/Monitoring/WorkManager.cs
@@ -85,6 +85,7 @@ namespace OpenSim.Framework.Monitoring
public static void Stop()
{
JobEngine.Stop();
+ Watchdog.Stop();
}
///
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index bc68681ff4..81dd3574ad 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -119,9 +119,10 @@ namespace OpenSim.Framework.Servers
Thread.Sleep(1000);
RemovePIDFile();
+
m_log.Info("[SHUTDOWN]: Shutdown processing on main thread complete. Exiting...");
- if (!SuppressExit)
+ if (!SuppressExit)
Environment.Exit(0);
}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs
index 5f57f39dd6..1688aa63ea 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs
@@ -231,6 +231,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
Watchdog.UpdateThread();
}
+ catch ( System.Threading.ThreadAbortException) { }
catch (Exception e)
{
m_log.Error("[ASYNC COMMAND MANAGER]: Exception in command handler pass: ", e);
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index 2e3903393e..c1abba2818 100755
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -1079,6 +1079,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
"[XEngine]: Started {0} scripts in {1}", scriptsStarted, m_Scene.Name);
}
}
+ catch (System.Threading.ThreadAbortException) { }
catch (Exception e)
{
m_log.Error(
diff --git a/OpenSim/Server/Base/ServicesServerBase.cs b/OpenSim/Server/Base/ServicesServerBase.cs
index 2185727a13..176e876af3 100644
--- a/OpenSim/Server/Base/ServicesServerBase.cs
+++ b/OpenSim/Server/Base/ServicesServerBase.cs
@@ -252,7 +252,7 @@ namespace OpenSim.Server.Base
MemoryWatchdog.Enabled = false;
Watchdog.Enabled = false;
-
+ WorkManager.Stop();
RemovePIDFile();
return 0;