diff options
author | Justin Clark-Casey (justincc) | 2011-10-25 20:49:46 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-10-25 20:49:46 +0100 |
commit | 968cae6c17fab8aa8a15bfd8231b50873aa6e794 (patch) | |
tree | 2c0f09c964f18a6b4a0977d9ac59afc84e556d9f /OpenSim/Framework/Servers | |
parent | Make OpenSim.Framework.Servers.HttpServer rely on OpenSim.Framework instead o... (diff) | |
download | opensim-SC_OLD-968cae6c17fab8aa8a15bfd8231b50873aa6e794.zip opensim-SC_OLD-968cae6c17fab8aa8a15bfd8231b50873aa6e794.tar.gz opensim-SC_OLD-968cae6c17fab8aa8a15bfd8231b50873aa6e794.tar.bz2 opensim-SC_OLD-968cae6c17fab8aa8a15bfd8231b50873aa6e794.tar.xz |
Add "threads abort <thread-id>" simulator console command that allows us to abort a watchdog managed thread.
This is for diagnostic purposes.
Diffstat (limited to 'OpenSim/Framework/Servers')
-rw-r--r-- | OpenSim/Framework/Servers/BaseOpenSimServer.cs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 688be3f..b242e1c 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs | |||
@@ -192,6 +192,10 @@ namespace OpenSim.Framework.Servers | |||
192 | m_console.Commands.AddCommand("base", false, "show version", | 192 | m_console.Commands.AddCommand("base", false, "show version", |
193 | "show version", | 193 | "show version", |
194 | "Show server version", HandleShow); | 194 | "Show server version", HandleShow); |
195 | |||
196 | m_console.Commands.AddCommand("base", false, "threads abort", | ||
197 | "threads abort <thread-id>", | ||
198 | "Abort a managed thread. Use \"show threads\" to find possible threads.", HandleThreadsAbort); | ||
195 | } | 199 | } |
196 | } | 200 | } |
197 | 201 | ||
@@ -395,6 +399,27 @@ namespace OpenSim.Framework.Servers | |||
395 | break; | 399 | break; |
396 | } | 400 | } |
397 | } | 401 | } |
402 | |||
403 | public virtual void HandleThreadsAbort(string module, string[] cmd) | ||
404 | { | ||
405 | if (cmd.Length != 3) | ||
406 | { | ||
407 | MainConsole.Instance.Output("Usage: threads abort <thread-id>"); | ||
408 | return; | ||
409 | } | ||
410 | |||
411 | int threadId; | ||
412 | if (!int.TryParse(cmd[2], out threadId)) | ||
413 | { | ||
414 | MainConsole.Instance.Output("ERROR: Thread id must be an integer"); | ||
415 | return; | ||
416 | } | ||
417 | |||
418 | if (Watchdog.AbortThread(threadId)) | ||
419 | MainConsole.Instance.OutputFormat("Aborted thread with id {0}", threadId); | ||
420 | else | ||
421 | MainConsole.Instance.OutputFormat("ERROR - Thread with id {0} not found in managed threads", threadId); | ||
422 | } | ||
398 | 423 | ||
399 | protected void ShowInfo() | 424 | protected void ShowInfo() |
400 | { | 425 | { |