[Mono-bugs] [Bug 58816][Wis] New - System.Timers

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 21 May 2004 16:34:32 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by jujibo@inicia.es.

http://bugzilla.ximian.com/show_bug.cgi?id=58816

--- shadow/58816	2004-05-21 16:34:32.000000000 -0400
+++ shadow/58816.tmp.4058	2004-05-21 16:34:32.000000000 -0400
@@ -0,0 +1,76 @@
+Bug#: 58816
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: jujibo@inicia.es               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Summary: System.Timers 
+
+Description of Problem:
+The while.... never ends when timer running.
+See the example below
+
+Steps to reproduce the problem:
+
+compile the program:
+
+// why this little program never stop when timer is running?
+
+using System;
+using System.Timers;
+
+public class Timer1
+{
+
+   public static void Main()
+   {
+       System.Timers.Timer aTimer = new System.Timers.Timer();
+       aTimer.Elapsed+=new ElapsedEventHandler(OnTimedEvent);
+       // Set the Interval to 1 seconds.
+       aTimer.Interval=1000;
+   //aTimer.AutoReset = false;
+       //aTimer.Enabled=true;
+   aTimer.Start ();
+
+       Console.WriteLine("Testing Timer, interval = 1 second. Press
+\'q\' to quit the sample.");
+       while(System.Console.Read()!='q');
+   }
+
+   // Specify what you want to happen when the Elapsed event is raised.
+   private static void OnTimedEvent(object source, ElapsedEventArgs e)
+   {
+       Console.WriteLine("Hello World!");
+   }
+} 
+
+Actual Results:
+
+when type letter q and then press intro key the the while loop never ends,
+and never execute instructions inside it
+
+Expected Results:
+
+pressing q key and intro the program must finish
+
+How often does this happen?
+
+the  System.Console.Read () never ends reading
+
+
+Additional Information:
+
+If timer never start the program run fine
+
+compiled with:
+Mono C# compiler version 0.91.99.0
+in Slackware Linux 9.1