Merge pull request #656 from LogosBible/collection_lock
[mono.git] / mcs / class / corlib / System / Console.cs
index 9eba75f6ed50085d8b3c6d6b0312506aeb0a8f71..08f8a4c1da1bfe92ecd879883d42b60b86374e1e 100644 (file)
@@ -94,12 +94,6 @@ namespace System
                private static TextWriter stderr;
                private static TextReader stdin;
 
-#if NET_4_5 && !MOBILE
-               static TextWriter console_stdout;
-               static TextWriter console_stderr;
-               static TextReader console_stdin;
-#endif
-
                static Console ()
                {
 #if NET_2_1
@@ -161,7 +155,7 @@ namespace System
 // FULL_AOT_RUNTIME is used (instead of MONOTOUCH) since we only want this code when running on 
 // iOS (simulator or devices) and *not* when running tools (e.g. btouch #12179) that needs to use 
 // the mscorlib.dll shipped with Xamarin.iOS
-#if FULL_AOT_RUNTIME
+#if MONOTOUCH && FULL_AOT_RUNTIME
                                stdout = new NSLogWriter ();
 #else
                                stdout = new UnexceptionalStreamWriter (OpenStandardOutput (0), outputEncoding);
@@ -169,7 +163,7 @@ namespace System
 #endif
                                stdout = TextWriter.Synchronized (stdout, true);
 
-#if FULL_AOT_RUNTIME
+#if MONOTOUCH && FULL_AOT_RUNTIME
                                stderr = new NSLogWriter ();
 #else
                                stderr = new UnexceptionalStreamWriter (OpenStandardError (0), outputEncoding); 
@@ -183,12 +177,6 @@ namespace System
                        }
 #endif
 
-#if NET_4_5 && !MOBILE
-                       console_stderr = stderr;
-                       console_stdout = stdout;
-                       console_stdin = stdin;
-#endif
-
 #if MONODROID
                        if (LogcatTextWriter.IsRunningOnAndroid ()) {
                                stdout = TextWriter.Synchronized (new LogcatTextWriter ("mono-stdout", stdout));
@@ -676,19 +664,19 @@ namespace System
 #if NET_4_5
                public static bool IsErrorRedirected {
                        get {
-                               return stderr != console_stderr || ConsoleDriver.IsErrorRedirected;
+                               return ConsoleDriver.IsErrorRedirected;
                        }
                }
 
                public static bool IsOutputRedirected {
                        get {
-                               return stdout != console_stdout || ConsoleDriver.IsOutputRedirected;
+                               return ConsoleDriver.IsOutputRedirected;
                        }
                }
 
                public static bool IsInputRedirected {
                        get {
-                               return stdin != console_stdin || ConsoleDriver.IsInputRedirected;
+                               return ConsoleDriver.IsInputRedirected;
                        }
                }
 #endif