aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Watchdog.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Watchdog.cs')
-rw-r--r--OpenSim/Framework/Watchdog.cs25
1 files changed, 23 insertions, 2 deletions
diff --git a/OpenSim/Framework/Watchdog.cs b/OpenSim/Framework/Watchdog.cs
index 0f34e83..c947ea6 100644
--- a/OpenSim/Framework/Watchdog.cs
+++ b/OpenSim/Framework/Watchdog.cs
@@ -112,8 +112,10 @@ namespace OpenSim.Framework
112 /// <summary> 112 /// <summary>
113 /// Stops watchdog tracking on the current thread 113 /// Stops watchdog tracking on the current thread
114 /// </summary> 114 /// </summary>
115 /// <returns>True if the thread was removed from the list of tracked 115 /// <returns>
116 /// threads, otherwise false</returns> 116 /// True if the thread was removed from the list of tracked
117 /// threads, otherwise false
118 /// </returns>
117 public static bool RemoveThread() 119 public static bool RemoveThread()
118 { 120 {
119 return RemoveThread(Thread.CurrentThread.ManagedThreadId); 121 return RemoveThread(Thread.CurrentThread.ManagedThreadId);
@@ -133,6 +135,25 @@ namespace OpenSim.Framework
133 return m_threads.Remove(threadID); 135 return m_threads.Remove(threadID);
134 } 136 }
135 137
138 public static bool AbortThread(int threadID)
139 {
140 lock (m_threads)
141 {
142 if (m_threads.ContainsKey(threadID))
143 {
144 ThreadWatchdogInfo twi = m_threads[threadID];
145 twi.Thread.Abort();
146 RemoveThread(threadID);
147
148 return true;
149 }
150 else
151 {
152 return false;
153 }
154 }
155 }
156
136 private static void UpdateThread(int threadID) 157 private static void UpdateThread(int threadID)
137 { 158 {
138 ThreadWatchdogInfo threadInfo; 159 ThreadWatchdogInfo threadInfo;