diff options
author | John Hurliman | 2009-10-22 12:33:23 -0700 |
---|---|---|
committer | John Hurliman | 2009-10-22 12:33:23 -0700 |
commit | b2ed348aa2746fbf034b713d006e40366c479d5a (patch) | |
tree | 26c114e88f54e64e1fdf17dcc7de1e54165db2bc /OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueThreadClass.cs | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-b2ed348aa2746fbf034b713d006e40366c479d5a.zip opensim-SC_OLD-b2ed348aa2746fbf034b713d006e40366c479d5a.tar.gz opensim-SC_OLD-b2ed348aa2746fbf034b713d006e40366c479d5a.tar.bz2 opensim-SC_OLD-b2ed348aa2746fbf034b713d006e40366c479d5a.tar.xz |
Implemented a Watchdog class. Do not manually create Thread objects anymore, use Watchdog.StartThread(). While your thread is running call Watchdog.UpdateThread(). When it is shutting down call Watchdog.RemoveThread(). Most of the threads in OpenSim have been updated
Diffstat (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueThreadClass.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueThreadClass.cs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueThreadClass.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueThreadClass.cs index 583d2ff..51fd41a 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueThreadClass.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueThreadClass.cs | |||
@@ -132,12 +132,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
132 | /// </summary> | 132 | /// </summary> |
133 | private void Start() | 133 | private void Start() |
134 | { | 134 | { |
135 | EventQueueThread = new Thread(EventQueueThreadLoop); | 135 | EventQueueThread = Watchdog.StartThread(EventQueueThreadLoop, "EventQueueManagerThread_" + ThreadCount, MyThreadPriority, true); |
136 | EventQueueThread.IsBackground = true; | ||
137 | |||
138 | EventQueueThread.Priority = MyThreadPriority; | ||
139 | EventQueueThread.Name = "EventQueueManagerThread_" + ThreadCount; | ||
140 | EventQueueThread.Start(); | ||
141 | 136 | ||
142 | // Look at this... Don't you wish everyone did that solid | 137 | // Look at this... Don't you wish everyone did that solid |
143 | // coding everywhere? :P | 138 | // coding everywhere? :P |
@@ -184,6 +179,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
184 | while (true) | 179 | while (true) |
185 | { | 180 | { |
186 | DoProcessQueue(); | 181 | DoProcessQueue(); |
182 | Watchdog.UpdateThread(); | ||
187 | } | 183 | } |
188 | } | 184 | } |
189 | catch (ThreadAbortException) | 185 | catch (ThreadAbortException) |
@@ -214,6 +210,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
214 | m_log.ErrorFormat("[{0}]: Exception {1} thrown", ScriptEngineName, e.GetType().ToString()); | 210 | m_log.ErrorFormat("[{0}]: Exception {1} thrown", ScriptEngineName, e.GetType().ToString()); |
215 | throw e; | 211 | throw e; |
216 | } | 212 | } |
213 | |||
214 | Watchdog.UpdateThread(); | ||
217 | } | 215 | } |
218 | } | 216 | } |
219 | catch (ThreadAbortException) | 217 | catch (ThreadAbortException) |
@@ -226,6 +224,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
226 | "[{0}]: Event queue thread terminating with exception. PLEASE REBOOT YOUR SIM - SCRIPT EVENTS WILL NOT WORK UNTIL YOU DO. Exception is {1}", | 224 | "[{0}]: Event queue thread terminating with exception. PLEASE REBOOT YOUR SIM - SCRIPT EVENTS WILL NOT WORK UNTIL YOU DO. Exception is {1}", |
227 | ScriptEngineName, e); | 225 | ScriptEngineName, e); |
228 | } | 226 | } |
227 | |||
228 | Watchdog.RemoveThread(); | ||
229 | } | 229 | } |
230 | 230 | ||
231 | public void DoProcessQueue() | 231 | public void DoProcessQueue() |