From 4031933475a8df81629862bfcdc497ac57d01223 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Wed, 27 Nov 2013 14:15:21 +0200 Subject: Refactored DebugFlagsEnum Resolves http://opensimulator.org/mantis/view.php?id=6945 --- OpenSim/Framework/Util.cs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 0dfee71..225d360 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -67,7 +67,7 @@ namespace OpenSim.Framework // All does not contain Export, which is special and must be // explicitly given All = (1 << 13) | (1 << 14) | (1 << 15) | (1 << 19) - } + } /// /// The method used by Util.FireAndForget for asynchronously firing events @@ -109,6 +109,15 @@ namespace OpenSim.Framework public int MaxConcurrentWorkItems { get; set; } } + [Flags] + public enum DebugFlagsEnum : uint + { + None = 0, + + // Log every invocation of a thread using the threadpool + LogThreadPool = 0x01 + } + /// /// Miscellaneous utility functions /// @@ -117,13 +126,13 @@ namespace OpenSim.Framework private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); /// - /// Log every invocation of a thread using the threadpool. + /// Flags that enable additional debugging. /// - public static bool LogThreadPool { get; set; } + public static DebugFlagsEnum DebugFlags { get; set; } static Util() { - LogThreadPool = false; + DebugFlags = DebugFlagsEnum.None; } private static uint nextXferID = 5000; @@ -1907,7 +1916,7 @@ namespace OpenSim.Framework { WaitCallback realCallback; - bool loggingEnabled = LogThreadPool; + bool loggingEnabled = (DebugFlags & DebugFlagsEnum.LogThreadPool) != 0; long threadFuncNum = Interlocked.Increment(ref nextThreadFuncNum); -- cgit v1.1