move assetsconnector threads to whatchdog; Abort all alive threads known to watchdog before exit
parent
0d31898fd6
commit
772c5b7db0
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add a thread to the watchdog tracker.
|
||||
/// </summary>
|
||||
|
|
|
@ -85,6 +85,7 @@ namespace OpenSim.Framework.Monitoring
|
|||
public static void Stop()
|
||||
{
|
||||
JobEngine.Stop();
|
||||
Watchdog.Stop();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -252,7 +252,7 @@ namespace OpenSim.Server.Base
|
|||
|
||||
MemoryWatchdog.Enabled = false;
|
||||
Watchdog.Enabled = false;
|
||||
|
||||
WorkManager.Stop();
|
||||
RemovePIDFile();
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue