From 4385fcdeaeed96bf9e5d137d13ea27bca83148bb Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 16 Mar 2012 03:52:13 +0000 Subject: [PATCH] Add total scripts count to "show threads" However, this returns 0 on Mono (at least on 2.6.7)! So not showing if it is zero. --- OpenSim/Framework/Servers/BaseOpenSimServer.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 1534899acb..cf0859ea6f 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs @@ -269,10 +269,18 @@ namespace OpenSim.Framework.Servers t.Priority, t.ThreadState); - sb.Append(Environment.NewLine); + sb.Append("\n"); } - sb.Append("\n*** Main threadpool (excluding script engine)***\n"); + sb.Append("\n"); + + // For some reason mono 2.6.7 returns an empty threads set! Not going to confuse people by reporting + // zero active threads. + int totalThreads = Process.GetCurrentProcess().Threads.Count; + if (totalThreads > 0) + sb.AppendFormat("Total threads active: {0}\n\n", Process.GetCurrentProcess().Threads.Count); + + sb.Append("Main threadpool (excluding script engine pools)\n"); sb.Append(Util.GetThreadPoolReport()); return sb.ToString();