dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] pnetlib/runtime/System Console.cs,1.16,1.17


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] pnetlib/runtime/System Console.cs,1.16,1.17
Date: Wed, 05 Nov 2003 09:37:44 +0000

Update of /cvsroot/dotgnu-pnet/pnetlib/runtime/System
In directory subversions:/tmp/cvs-serv29512/runtime/System

Modified Files:
        Console.cs 
Log Message:


Use different lock objects for console input and console output so that
it is possible to wait for a key in one thread while outputting text in another.


Index: Console.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Console.cs,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** Console.cs  3 Nov 2003 05:20:36 -0000       1.16
--- Console.cs  5 Nov 2003 09:37:42 -0000       1.17
***************
*** 558,561 ****
--- 558,562 ----
        private static bool specialMode = false;
        private static bool treatControlCAsInput = false;
+       private static Object readLock = new Object();
  
        // Enable the "normal" input mode on the console.
***************
*** 638,641 ****
--- 639,645 ----
                                {
                                        SpecialMode();
+                               }
+                               lock(readLock)
+                               {
                                        char ch;
                                        int key, modifiers;
***************
*** 747,750 ****
--- 751,757 ----
                                        {
                                                SpecialMode();
+                                       }
+                                       lock(readLock)
+                                       {
                                                return Stdio.KeyAvailable();
                                        }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]