aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorUbitUmarov2017-05-25 06:05:02 +0100
committerUbitUmarov2017-05-25 06:05:02 +0100
commit772c5b7db030eb95da8852d711323244cfa91ab4 (patch)
tree8cc90e4081377edf98804513d606ad217c9e6751 /OpenSim/Framework
parentUpdate macOS version of libode to 0.13.2. The library is build as a fat libra... (diff)
downloadopensim-SC_OLD-772c5b7db030eb95da8852d711323244cfa91ab4.zip
opensim-SC_OLD-772c5b7db030eb95da8852d711323244cfa91ab4.tar.gz
opensim-SC_OLD-772c5b7db030eb95da8852d711323244cfa91ab4.tar.bz2
opensim-SC_OLD-772c5b7db030eb95da8852d711323244cfa91ab4.tar.xz
move assetsconnector threads to whatchdog; Abort all alive threads known to watchdog before exit
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Monitoring/Watchdog.cs24
-rw-r--r--OpenSim/Framework/Monitoring/WorkManager.cs1
-rw-r--r--OpenSim/Framework/Servers/BaseOpenSimServer.cs3
3 files changed, 27 insertions, 1 deletions
diff --git a/OpenSim/Framework/Monitoring/Watchdog.cs b/OpenSim/Framework/Monitoring/Watchdog.cs
index 9cc61ee..8a4894e 100644
--- a/OpenSim/Framework/Monitoring/Watchdog.cs
+++ b/OpenSim/Framework/Monitoring/Watchdog.cs
@@ -180,6 +180,30 @@ namespace OpenSim.Framework.Monitoring
180 m_watchdogTimer.Elapsed += WatchdogTimerElapsed; 180 m_watchdogTimer.Elapsed += WatchdogTimerElapsed;
181 } 181 }
182 182
183 public static void Stop()
184 {
185 if(m_threads == null)
186 return;
187
188 lock(m_threads)
189 {
190 m_enabled = false;
191 if(m_watchdogTimer != null)
192 {
193 m_watchdogTimer.Dispose();
194 m_watchdogTimer = null;
195 }
196
197 foreach(ThreadWatchdogInfo twi in m_threads.Values)
198 {
199 Thread t = twi.Thread;
200 if(t.IsAlive)
201 t.Abort();
202 }
203 m_threads.Clear();
204 }
205 }
206
183 /// <summary> 207 /// <summary>
184 /// Add a thread to the watchdog tracker. 208 /// Add a thread to the watchdog tracker.
185 /// </summary> 209 /// </summary>
diff --git a/OpenSim/Framework/Monitoring/WorkManager.cs b/OpenSim/Framework/Monitoring/WorkManager.cs
index a3e0390..9d52f71 100644
--- a/OpenSim/Framework/Monitoring/WorkManager.cs
+++ b/OpenSim/Framework/Monitoring/WorkManager.cs
@@ -85,6 +85,7 @@ namespace OpenSim.Framework.Monitoring
85 public static void Stop() 85 public static void Stop()
86 { 86 {
87 JobEngine.Stop(); 87 JobEngine.Stop();
88 Watchdog.Stop();
88 } 89 }
89 90
90 /// <summary> 91 /// <summary>
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index bc68681..81dd357 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -119,9 +119,10 @@ namespace OpenSim.Framework.Servers
119 119
120 Thread.Sleep(1000); 120 Thread.Sleep(1000);
121 RemovePIDFile(); 121 RemovePIDFile();
122
122 m_log.Info("[SHUTDOWN]: Shutdown processing on main thread complete. Exiting..."); 123 m_log.Info("[SHUTDOWN]: Shutdown processing on main thread complete. Exiting...");
123 124
124 if (!SuppressExit) 125 if (!SuppressExit)
125 Environment.Exit(0); 126 Environment.Exit(0);
126 } 127 }
127 128