From 2519f071f2c592aeea0414c8b2871e5df623271c Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Tue, 6 Oct 2009 02:50:59 -0700 Subject: Fixing a few compile errors in the previous commit --- OpenSim/Framework/Servers/BaseOpenSimServer.cs | 27 ++++++-------------------- 1 file changed, 6 insertions(+), 21 deletions(-) (limited to 'OpenSim/Framework/Servers') diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 56155dd..8e58980 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs @@ -27,6 +27,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Reflection; using System.Text; @@ -109,9 +110,8 @@ namespace OpenSim.Framework.Servers m_periodicDiagnosticsTimer.Elapsed += new ElapsedEventHandler(LogDiagnostics); m_periodicDiagnosticsTimer.Enabled = true; - // Add ourselves to thread monitoring. This thread will go on to become the console listening thread + // This thread will go on to become the console listening thread Thread.CurrentThread.Name = "ConsoleThread"; - ThreadTracker.Add(Thread.CurrentThread); ILoggerRepository repository = LogManager.GetRepository(); IAppender[] appenders = repository.GetAppenders(); @@ -235,7 +235,7 @@ namespace OpenSim.Framework.Servers { StringBuilder sb = new StringBuilder(); - List threads = ThreadTracker.GetThreads(); + ProcessThreadCollection threads = ThreadTracker.GetThreads(); if (threads == null) { sb.Append("OpenSim thread tracking is only enabled in DEBUG mode."); @@ -243,25 +243,10 @@ namespace OpenSim.Framework.Servers else { sb.Append(threads.Count + " threads are being tracked:" + Environment.NewLine); - foreach (Thread t in threads) + foreach (ProcessThread t in threads) { - if (t.IsAlive) - { - sb.Append( - "ID: " + t.ManagedThreadId + ", Name: " + t.Name + ", Alive: " + t.IsAlive - + ", Pri: " + t.Priority + ", State: " + t.ThreadState + Environment.NewLine); - } - else - { - try - { - sb.Append("ID: " + t.ManagedThreadId + ", Name: " + t.Name + ", DEAD" + Environment.NewLine); - } - catch - { - sb.Append("THREAD ERROR" + Environment.NewLine); - } - } + sb.Append("ID: " + t.Id + ", TotalProcessorTime: " + t.TotalProcessorTime + ", TimeRunning: " + + (DateTime.Now - t.StartTime) + ", Pri: " + t.CurrentPriority + ", State: " + t.ThreadState + Environment.NewLine); } } int workers = 0, ports = 0, maxWorkers = 0, maxPorts = 0; -- cgit v1.1 From ab3bfca54631d55ff951ce02b3f99e64e2ea7367 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 7 Oct 2009 17:29:21 -0700 Subject: Printout one more field in show threads, but this won't buy us much. --- OpenSim/Framework/Servers/BaseOpenSimServer.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework/Servers') diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 8e58980..4179dd3 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs @@ -246,7 +246,8 @@ namespace OpenSim.Framework.Servers foreach (ProcessThread t in threads) { sb.Append("ID: " + t.Id + ", TotalProcessorTime: " + t.TotalProcessorTime + ", TimeRunning: " + - (DateTime.Now - t.StartTime) + ", Pri: " + t.CurrentPriority + ", State: " + t.ThreadState + Environment.NewLine); + (DateTime.Now - t.StartTime) + ", Pri: " + t.CurrentPriority + ", State: " + t.ThreadState + + ", WaitReason: " + t.WaitReason + Environment.NewLine); } } int workers = 0, ports = 0, maxWorkers = 0, maxPorts = 0; -- cgit v1.1 From 29f03d95f3648dff881a2d91444a71c770390ec9 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 7 Oct 2009 19:20:34 -0700 Subject: Bug fix. --- OpenSim/Framework/Servers/BaseOpenSimServer.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework/Servers') diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 4179dd3..845a9fe 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs @@ -246,8 +246,12 @@ namespace OpenSim.Framework.Servers foreach (ProcessThread t in threads) { sb.Append("ID: " + t.Id + ", TotalProcessorTime: " + t.TotalProcessorTime + ", TimeRunning: " + - (DateTime.Now - t.StartTime) + ", Pri: " + t.CurrentPriority + ", State: " + t.ThreadState + - ", WaitReason: " + t.WaitReason + Environment.NewLine); + (DateTime.Now - t.StartTime) + ", Pri: " + t.CurrentPriority + ", State: " + t.ThreadState ); + if (t.ThreadState == System.Diagnostics.ThreadState.Wait) + sb.Append(", Reason: " + t.WaitReason + Environment.NewLine); + else + sb.Append(Environment.NewLine); + } } int workers = 0, ports = 0, maxWorkers = 0, maxPorts = 0; -- cgit v1.1