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