aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers/BaseOpenSimServer.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Servers/BaseOpenSimServer.cs30
1 files changed, 30 insertions, 0 deletions
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index 64b9c3e..66d0813 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -192,6 +192,15 @@ 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);
199
200 m_console.Commands.AddCommand("base", false, "threads show",
201 "threads show",
202 "Show thread status. Synonym for \"show threads\"",
203 (string module, string[] args) => Notice(GetThreadsReport()));
195 } 204 }
196 } 205 }
197 206
@@ -395,6 +404,27 @@ namespace OpenSim.Framework.Servers
395 break; 404 break;
396 } 405 }
397 } 406 }
407
408 public virtual void HandleThreadsAbort(string module, string[] cmd)
409 {
410 if (cmd.Length != 3)
411 {
412 MainConsole.Instance.Output("Usage: threads abort <thread-id>");
413 return;
414 }
415
416 int threadId;
417 if (!int.TryParse(cmd[2], out threadId))
418 {
419 MainConsole.Instance.Output("ERROR: Thread id must be an integer");
420 return;
421 }
422
423 if (Watchdog.AbortThread(threadId))
424 MainConsole.Instance.OutputFormat("Aborted thread with id {0}", threadId);
425 else
426 MainConsole.Instance.OutputFormat("ERROR - Thread with id {0} not found in managed threads", threadId);
427 }
398 428
399 protected void ShowInfo() 429 protected void ShowInfo()
400 { 430 {