diff options
author | UbitUmarov | 2017-05-25 06:05:02 +0100 |
---|---|---|
committer | UbitUmarov | 2017-05-25 06:05:02 +0100 |
commit | 772c5b7db030eb95da8852d711323244cfa91ab4 (patch) | |
tree | 8cc90e4081377edf98804513d606ad217c9e6751 /OpenSim | |
parent | Update macOS version of libode to 0.13.2. The library is build as a fat libra... (diff) | |
download | opensim-SC-772c5b7db030eb95da8852d711323244cfa91ab4.zip opensim-SC-772c5b7db030eb95da8852d711323244cfa91ab4.tar.gz opensim-SC-772c5b7db030eb95da8852d711323244cfa91ab4.tar.bz2 opensim-SC-772c5b7db030eb95da8852d711323244cfa91ab4.tar.xz |
move assetsconnector threads to whatchdog; Abort all alive threads known to watchdog before exit
Diffstat (limited to '')
6 files changed, 30 insertions, 2 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 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs index 5f57f39..1688aa6 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 | |||
231 | 231 | ||
232 | Watchdog.UpdateThread(); | 232 | Watchdog.UpdateThread(); |
233 | } | 233 | } |
234 | catch ( System.Threading.ThreadAbortException) { } | ||
234 | catch (Exception e) | 235 | catch (Exception e) |
235 | { | 236 | { |
236 | m_log.Error("[ASYNC COMMAND MANAGER]: Exception in command handler pass: ", e); | 237 | 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 2e39033..c1abba2 100755 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -1079,6 +1079,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1079 | "[XEngine]: Started {0} scripts in {1}", scriptsStarted, m_Scene.Name); | 1079 | "[XEngine]: Started {0} scripts in {1}", scriptsStarted, m_Scene.Name); |
1080 | } | 1080 | } |
1081 | } | 1081 | } |
1082 | catch (System.Threading.ThreadAbortException) { } | ||
1082 | catch (Exception e) | 1083 | catch (Exception e) |
1083 | { | 1084 | { |
1084 | m_log.Error( | 1085 | m_log.Error( |
diff --git a/OpenSim/Server/Base/ServicesServerBase.cs b/OpenSim/Server/Base/ServicesServerBase.cs index 2185727..176e876 100644 --- a/OpenSim/Server/Base/ServicesServerBase.cs +++ b/OpenSim/Server/Base/ServicesServerBase.cs | |||
@@ -252,7 +252,7 @@ namespace OpenSim.Server.Base | |||
252 | 252 | ||
253 | MemoryWatchdog.Enabled = false; | 253 | MemoryWatchdog.Enabled = false; |
254 | Watchdog.Enabled = false; | 254 | Watchdog.Enabled = false; |
255 | 255 | WorkManager.Stop(); | |
256 | RemovePIDFile(); | 256 | RemovePIDFile(); |
257 | 257 | ||
258 | return 0; | 258 | return 0; |