New test.
[mono.git] / mcs / class / System / System.Diagnostics / TraceImpl.cs
index 10f22ed2764dc63cfa0d415ec9dd82e9b7cabbe3..cc66f12d304a778b0a752f8c72fcf1c4fe927d43 100644 (file)
@@ -72,11 +72,11 @@ namespace System.Diagnostics {
                        get {return indentLevel;}
                        set {
                                lock (ListenersSyncRoot) {
+                                       indentLevel = value;
+
                                        foreach (TraceListener t in Listeners) {
                                                t.IndentLevel = indentLevel;
                                        }
-
-                                       indentLevel = value;
                                }
                        }
                }
@@ -85,11 +85,11 @@ namespace System.Diagnostics {
                        get {return indentSize;}
                        set {
                                lock (ListenersSyncRoot) {
+                                       indentSize = value;
+
                                        foreach (TraceListener t in Listeners) {
                                                t.IndentSize = indentSize;
                                        }
-
-                                       indentSize = value;
                                }
                        }
                }
@@ -126,8 +126,9 @@ namespace System.Diagnostics {
                // The DiagnosticsConfigurationHandler assumes that the TraceImpl.Listeners
                // collection exists (so it can initialize the DefaultTraceListener and
                // add/remove existing listeners).
-               private static void InitOnce ()
+               private static object InitOnce ()
                {
+                       object d = null;
 #if !NO_LOCK_FREE
                        // The lock-free version
                        if (listeners == null) {
@@ -135,10 +136,7 @@ namespace System.Diagnostics {
                                Thread.MemoryBarrier ();
                                while (Interlocked.CompareExchange (ref listeners, c, null) == null) {
                                        // Read in the .config file and get the ball rolling...
-                                       System.Collections.IDictionary d = DiagnosticsConfiguration.Settings;
-
-                                       // remove warning about unused temporary
-                                       d = d;
+                                       d = DiagnosticsConfiguration.Settings;
                                }
                                Thread.MemoryBarrier ();
                        }
@@ -147,15 +145,12 @@ namespace System.Diagnostics {
                        lock (lock_) {
                                if (listeners == null) {
                                        listeners = new TraceListenerCollection ();
-
                                        // Read in the .config file and get the ball rolling...
-                                       System.Collections.IDictionary d = DiagnosticsConfiguration.Settings;
-
-                                       // remove warning about unused temporary
-                                       d = d;
+                                       d = DiagnosticsConfiguration.Settings;
                                }
                        }
 #endif
+                       return d;
                }
 
                // FIXME: According to MSDN, this method should display a dialog box