LogThreadPool: when the thread is for ProcessPacketMethod, also log the packet type

Resolves http://opensimulator.org/mantis/view.php?id=6945
0.8.0.3
Oren Hurvitz 2013-12-19 10:51:10 +02:00
parent 4031933475
commit e735f76553
2 changed files with 13 additions and 4 deletions

View File

@ -1864,7 +1864,7 @@ namespace OpenSim.Framework
public static void FireAndForget(System.Threading.WaitCallback callback) public static void FireAndForget(System.Threading.WaitCallback callback)
{ {
FireAndForget(callback, null); FireAndForget(callback, null, null);
} }
public static void InitThreadPool(int minThreads, int maxThreads) public static void InitThreadPool(int minThreads, int maxThreads)
@ -1913,6 +1913,11 @@ namespace OpenSim.Framework
private static Int32 threadFuncOverloadMode = 0; private static Int32 threadFuncOverloadMode = 0;
public static void FireAndForget(System.Threading.WaitCallback callback, object obj) 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; WaitCallback realCallback;
@ -1973,8 +1978,12 @@ namespace OpenSim.Framework
} }
if (loggingEnabled || (threadFuncOverloadMode == 1)) 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) switch (FireAndForgetMethod)
{ {

View File

@ -694,7 +694,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
cinfo.AsyncRequests[packet.Type.ToString()]++; cinfo.AsyncRequests[packet.Type.ToString()]++;
object obj = new AsyncPacketProcess(this, pprocessor.method, packet); object obj = new AsyncPacketProcess(this, pprocessor.method, packet);
Util.FireAndForget(ProcessSpecificPacketAsync, obj); Util.FireAndForget(ProcessSpecificPacketAsync, obj, packet.Type.ToString());
result = true; result = true;
} }
else else