mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
move assetsconnector threads to whatchdog; Abort all alive threads known to watchdog before exit
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user