diff options
Diffstat (limited to 'OpenSim/Framework/Util.cs')
-rw-r--r-- | OpenSim/Framework/Util.cs | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index e76a37b..d206fc1 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -1753,12 +1753,16 @@ namespace OpenSim.Framework | |||
1753 | StringBuilder sb = new StringBuilder(); | 1753 | StringBuilder sb = new StringBuilder(); |
1754 | if (FireAndForgetMethod == FireAndForgetMethod.SmartThreadPool) | 1754 | if (FireAndForgetMethod == FireAndForgetMethod.SmartThreadPool) |
1755 | { | 1755 | { |
1756 | threadPoolUsed = "SmartThreadPool"; | 1756 | // ROBUST currently leaves this the FireAndForgetMethod but never actually initializes the threadpool. |
1757 | maxThreads = m_ThreadPool.MaxThreads; | 1757 | if (m_ThreadPool != null) |
1758 | minThreads = m_ThreadPool.MinThreads; | 1758 | { |
1759 | inUseThreads = m_ThreadPool.InUseThreads; | 1759 | threadPoolUsed = "SmartThreadPool"; |
1760 | allocatedThreads = m_ThreadPool.ActiveThreads; | 1760 | maxThreads = m_ThreadPool.MaxThreads; |
1761 | waitingCallbacks = m_ThreadPool.WaitingCallbacks; | 1761 | minThreads = m_ThreadPool.MinThreads; |
1762 | inUseThreads = m_ThreadPool.InUseThreads; | ||
1763 | allocatedThreads = m_ThreadPool.ActiveThreads; | ||
1764 | waitingCallbacks = m_ThreadPool.WaitingCallbacks; | ||
1765 | } | ||
1762 | } | 1766 | } |
1763 | else if ( | 1767 | else if ( |
1764 | FireAndForgetMethod == FireAndForgetMethod.UnsafeQueueUserWorkItem | 1768 | FireAndForgetMethod == FireAndForgetMethod.UnsafeQueueUserWorkItem |
@@ -1863,6 +1867,12 @@ namespace OpenSim.Framework | |||
1863 | /// </summary> | 1867 | /// </summary> |
1864 | public static void PrintCallStack() | 1868 | public static void PrintCallStack() |
1865 | { | 1869 | { |
1870 | PrintCallStack(m_log.DebugFormat); | ||
1871 | } | ||
1872 | |||
1873 | public delegate void DebugPrinter(string msg, params Object[] parm); | ||
1874 | public static void PrintCallStack(DebugPrinter printer) | ||
1875 | { | ||
1866 | StackTrace stackTrace = new StackTrace(true); // get call stack | 1876 | StackTrace stackTrace = new StackTrace(true); // get call stack |
1867 | StackFrame[] stackFrames = stackTrace.GetFrames(); // get method calls (frames) | 1877 | StackFrame[] stackFrames = stackTrace.GetFrames(); // get method calls (frames) |
1868 | 1878 | ||
@@ -1870,7 +1880,7 @@ namespace OpenSim.Framework | |||
1870 | foreach (StackFrame stackFrame in stackFrames) | 1880 | foreach (StackFrame stackFrame in stackFrames) |
1871 | { | 1881 | { |
1872 | MethodBase mb = stackFrame.GetMethod(); | 1882 | MethodBase mb = stackFrame.GetMethod(); |
1873 | m_log.DebugFormat("{0}.{1}:{2}", mb.DeclaringType, mb.Name, stackFrame.GetFileLineNumber()); // write method name | 1883 | printer("{0}.{1}:{2}", mb.DeclaringType, mb.Name, stackFrame.GetFileLineNumber()); // write method name |
1874 | } | 1884 | } |
1875 | } | 1885 | } |
1876 | 1886 | ||