diff options
author | Tedd Hansen | 2008-02-21 10:43:24 +0000 |
---|---|---|
committer | Tedd Hansen | 2008-02-21 10:43:24 +0000 |
commit | 7102ac77698f4bfd7406d6e8871db7b006c2cae2 (patch) | |
tree | 7253775d1a6ae64e2469b1ef79863aaebe83e1d1 /OpenSim/Region/Application | |
parent | Remove a couple compiler warnings. (diff) | |
download | opensim-SC_OLD-7102ac77698f4bfd7406d6e8871db7b006c2cae2.zip opensim-SC_OLD-7102ac77698f4bfd7406d6e8871db7b006c2cae2.tar.gz opensim-SC_OLD-7102ac77698f4bfd7406d6e8871db7b006c2cae2.tar.bz2 opensim-SC_OLD-7102ac77698f4bfd7406d6e8871db7b006c2cae2.tar.xz |
"threads" command now works. I've added manual tracking of threads (only if compiled in DEBUG mode)... Its ugly and even requires a separate thread to track the treads, but it will be very valuable in debugging.
Diffstat (limited to 'OpenSim/Region/Application')
-rw-r--r-- | OpenSim/Region/Application/OpenSimMain.cs | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index fc739d9..59f7c63 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs | |||
@@ -754,15 +754,30 @@ namespace OpenSim | |||
754 | break; | 754 | break; |
755 | 755 | ||
756 | case "threads": | 756 | case "threads": |
757 | m_console.Notice("THREAD", Process.GetCurrentProcess().Threads.Count + " threads running:"); | 757 | //m_console.Notice("THREAD", Process.GetCurrentProcess().Threads.Count + " threads running:"); |
758 | int _tc = 0; | 758 | //int _tc = 0; |
759 | 759 | ||
760 | foreach (ProcessThread pt in Process.GetCurrentProcess().Threads) | 760 | //foreach (ProcessThread pt in Process.GetCurrentProcess().Threads) |
761 | //{ | ||
762 | // _tc++; | ||
763 | // m_console.Notice("THREAD", _tc + ": ID: " + pt.Id + ", Started: " + pt.StartTime.ToString() + ", CPU time: " + pt.TotalProcessorTime + ", Pri: " + pt.BasePriority.ToString() + ", State: " + pt.ThreadState.ToString()); | ||
764 | |||
765 | //} | ||
766 | List<Thread> threads = OpenSim.Framework.ThreadTracker.GetThreads(); | ||
767 | if (threads == null) | ||
768 | { | ||
769 | m_console.Notice("THREAD", "Thread tracking is only enabled in DEBUG mode."); | ||
770 | } | ||
771 | else | ||
772 | { | ||
773 | int _tc = 0; | ||
774 | m_console.Notice("THREAD", threads.Count + " threads are being tracked:"); | ||
775 | foreach (Thread t in threads) | ||
761 | { | 776 | { |
762 | _tc++; | 777 | _tc++; |
763 | m_console.Notice("THREAD", _tc + ": ID: " + pt.Id + ", Started: " + pt.StartTime.ToString() + ", CPU time: " + pt.TotalProcessorTime + ", Pri: " + pt.BasePriority.ToString() + ", State: " + pt.ThreadState.ToString()); | 778 | m_console.Notice("THREAD", _tc + ": ID: " + t.ManagedThreadId.ToString() + ", Name: " + t.Name + ", Alive: " + t.IsAlive.ToString() + ", Pri: " + t.Priority.ToString() + ", State: " + t.ThreadState.ToString()); |
764 | |||
765 | } | 779 | } |
780 | } | ||
766 | 781 | ||
767 | 782 | ||
768 | break; | 783 | break; |