From bece2023e754d3d2c09753ad853f68c84243505c Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 16 Mar 2012 03:52:13 +0000
Subject: 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 5c74ac9..6da1436 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();
-- 
cgit v1.1