Add "show threadpool calls" command to show count of all labelled smartthreadpool calls

This commit is contained in:
Justin Clark-Casey (justincc)
2014-11-03 23:49:11 +00:00
parent 8c9f82b035
commit 72cb1cc7d6
3 changed files with 37 additions and 1 deletions

View File

@@ -2086,14 +2086,28 @@ namespace OpenSim.Framework
}
}
public static Dictionary<string, int> GetFireAndForgetCallsMade()
{
return new Dictionary<string, int>(m_fireAndForgetCallsMade);
}
private static Dictionary<string, int> m_fireAndForgetCallsMade = new Dictionary<string, int>();
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)
{
if (context != null)
{
if (!m_fireAndForgetCallsMade.ContainsKey(context))
m_fireAndForgetCallsMade[context] = 1;
else
m_fireAndForgetCallsMade[context]++;
}
WaitCallback realCallback;
bool loggingEnabled = LogThreadPool > 0;