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.
0.7.3-post-fixes
Justin Clark-Casey (justincc) 2012-03-16 03:52:13 +00:00
parent 04eb170624
commit 4385fcdeae
1 changed files with 10 additions and 2 deletions

View File

@ -269,10 +269,18 @@ namespace OpenSim.Framework.Servers
t.Priority, t.Priority,
t.ThreadState); 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()); sb.Append(Util.GetThreadPoolReport());
return sb.ToString(); return sb.ToString();