diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Util.cs | 19 |
1 files 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 | |||
67 | // All does not contain Export, which is special and must be | 67 | // All does not contain Export, which is special and must be |
68 | // explicitly given | 68 | // explicitly given |
69 | All = (1 << 13) | (1 << 14) | (1 << 15) | (1 << 19) | 69 | All = (1 << 13) | (1 << 14) | (1 << 15) | (1 << 19) |
70 | } | 70 | } |
71 | 71 | ||
72 | /// <summary> | 72 | /// <summary> |
73 | /// The method used by Util.FireAndForget for asynchronously firing events | 73 | /// The method used by Util.FireAndForget for asynchronously firing events |
@@ -109,6 +109,15 @@ namespace OpenSim.Framework | |||
109 | public int MaxConcurrentWorkItems { get; set; } | 109 | public int MaxConcurrentWorkItems { get; set; } |
110 | } | 110 | } |
111 | 111 | ||
112 | [Flags] | ||
113 | public enum DebugFlagsEnum : uint | ||
114 | { | ||
115 | None = 0, | ||
116 | |||
117 | // Log every invocation of a thread using the threadpool | ||
118 | LogThreadPool = 0x01 | ||
119 | } | ||
120 | |||
112 | /// <summary> | 121 | /// <summary> |
113 | /// Miscellaneous utility functions | 122 | /// Miscellaneous utility functions |
114 | /// </summary> | 123 | /// </summary> |
@@ -117,13 +126,13 @@ namespace OpenSim.Framework | |||
117 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 126 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
118 | 127 | ||
119 | /// <summary> | 128 | /// <summary> |
120 | /// Log every invocation of a thread using the threadpool. | 129 | /// Flags that enable additional debugging. |
121 | /// </summary> | 130 | /// </summary> |
122 | public static bool LogThreadPool { get; set; } | 131 | public static DebugFlagsEnum DebugFlags { get; set; } |
123 | 132 | ||
124 | static Util() | 133 | static Util() |
125 | { | 134 | { |
126 | LogThreadPool = false; | 135 | DebugFlags = DebugFlagsEnum.None; |
127 | } | 136 | } |
128 | 137 | ||
129 | private static uint nextXferID = 5000; | 138 | private static uint nextXferID = 5000; |
@@ -1907,7 +1916,7 @@ namespace OpenSim.Framework | |||
1907 | { | 1916 | { |
1908 | WaitCallback realCallback; | 1917 | WaitCallback realCallback; |
1909 | 1918 | ||
1910 | bool loggingEnabled = LogThreadPool; | 1919 | bool loggingEnabled = (DebugFlags & DebugFlagsEnum.LogThreadPool) != 0; |
1911 | 1920 | ||
1912 | long threadFuncNum = Interlocked.Increment(ref nextThreadFuncNum); | 1921 | long threadFuncNum = Interlocked.Increment(ref nextThreadFuncNum); |
1913 | 1922 | ||