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/Framework/Monitoring/Watchdog.cs | |
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 'OpenSim/Framework/Monitoring/Watchdog.cs')
-rw-r--r-- | OpenSim/Framework/Monitoring/Watchdog.cs | 24 |
1 files changed, 24 insertions, 0 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> |