From e735f765539dc2f9a6b5d072b114a5b0116dba9f Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Thu, 19 Dec 2013 10:51:10 +0200 Subject: LogThreadPool: when the thread is for ProcessPacketMethod, also log the packet type Resolves http://opensimulator.org/mantis/view.php?id=6945 --- OpenSim/Framework/Util.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'OpenSim/Framework/Util.cs') diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 225d360..6be1722 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -1864,7 +1864,7 @@ namespace OpenSim.Framework public static void FireAndForget(System.Threading.WaitCallback callback) { - FireAndForget(callback, null); + FireAndForget(callback, null, null); } public static void InitThreadPool(int minThreads, int maxThreads) @@ -1914,6 +1914,11 @@ namespace OpenSim.Framework public static void FireAndForget(System.Threading.WaitCallback callback, object obj) { + FireAndForget(callback, obj, null); + } + + public static void FireAndForget(System.Threading.WaitCallback callback, object obj, string context) + { WaitCallback realCallback; bool loggingEnabled = (DebugFlags & DebugFlagsEnum.LogThreadPool) != 0; @@ -1973,8 +1978,12 @@ namespace OpenSim.Framework } if (loggingEnabled || (threadFuncOverloadMode == 1)) - m_log.DebugFormat("Queue threadfunc {0} (Queued {1}, Running {2}) {3}", - threadFuncNum, numQueued, numRunningThreadFuncs, GetFireAndForgetStackTrace(loggingEnabled)); + { + m_log.DebugFormat("Queue threadfunc {0} (Queued {1}, Running {2}) {3}{4}", + threadFuncNum, numQueued, numRunningThreadFuncs, + (context == null) ? "" : ("(" + context + ") "), + GetFireAndForgetStackTrace(loggingEnabled)); + } switch (FireAndForgetMethod) { -- cgit v1.1