From e735f765539dc2f9a6b5d072b114a5b0116dba9f Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Thu, 19 Dec 2013 10:51:10 +0200 Subject: [PATCH] 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 ++++++++++++--- .../Region/ClientStack/Linden/UDP/LLClientView.cs | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 225d360fe3..6be172246c 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) @@ -1913,6 +1913,11 @@ namespace OpenSim.Framework private static Int32 threadFuncOverloadMode = 0; 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; @@ -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) { diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 86161c9180..d9fe4e27f9 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -694,7 +694,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP cinfo.AsyncRequests[packet.Type.ToString()]++; object obj = new AsyncPacketProcess(this, pprocessor.method, packet); - Util.FireAndForget(ProcessSpecificPacketAsync, obj); + Util.FireAndForget(ProcessSpecificPacketAsync, obj, packet.Type.ToString()); result = true; } else