diff options
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> |