From 72cb1cc7d6b1dc69e959581817c70e92435d002f Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 3 Nov 2014 23:49:11 +0000 Subject: Add "show threadpool calls" command to show count of all labelled smartthreadpool calls --- OpenSim/Framework/Util.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework/Util.cs') diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index fefa050..53bbb06 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -2086,14 +2086,28 @@ namespace OpenSim.Framework } } + public static Dictionary GetFireAndForgetCallsMade() + { + return new Dictionary(m_fireAndForgetCallsMade); + } + + private static Dictionary m_fireAndForgetCallsMade = new Dictionary(); 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; -- cgit v1.1