[Mono-bugs] [Bug 56728][Nor] New - Timer not calling callback when dueTime = 0 and period is Timeout.Infinite

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 8 Apr 2004 19:27:18 -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 gmiyake@carter-inc.com.

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

--- shadow/56728	2004-04-08 19:27:18.000000000 -0400
+++ shadow/56728.tmp.14937	2004-04-08 19:27:18.000000000 -0400
@@ -0,0 +1,98 @@
+Bug#: 56728
+Product: Mono: Runtime
+Version: unspecified
+OS: Red Hat 9.0
+OS Details: RH 9, Mono 0.31.99
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: gmiyake@carter-inc.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Timer not calling callback when dueTime = 0 and period is Timeout.Infinite
+
+Please fill in this template when reporting a bug, unless you know what 
+you are doing.
+Description of Problem:
+
+When a timer is changed to go off immediately with a call to "Timer.Change
+(0,Timeout.Infinite)" the callback does not get called. This works 
+in .NET 1.1.
+
+Steps to reproduce the problem:
+1. Execute the following test: mono TimerTest.exe
+2. 
+3. 
+
+Actual Results:
+
+The callback does not get called so the console only shows:
+
+Press Enter to exit.
+
+Expected Results:
+
+Expected to get the output from the callback :
+
+Callback called
+Press Enter to exit.
+
+How often does this happen? 
+Always.
+
+Additional Information:
+
+Test Code Follows
+-------------------------------------------------------------------------
+
+using System;
+using System.Threading;
+namespace TimerTest
+{
+	/// <summary>
+	/// Summary description for Class1.
+	/// </summary>
+	class TimerTest
+	{
+        private Timer myTimer;
+        
+        public TimerTest() 
+        {
+            TimerCallback timerDelegate = new TimerCallback
+(CallBackMethod);
+            myTimer = new Timer(timerDelegate, null,
+                          Timeout.Infinite, Timeout.Infinite);
+
+
+        }
+
+        public void SendChange() 
+        {
+           myTimer.Change(0, Timeout.Infinite);
+        }
+
+        private void CallBackMethod(object pNotUsed)
+        {
+               Console.WriteLine("Callback called");
+        }
+
+		/// <summary>
+		/// The main entry point for the application.
+		/// </summary>
+		[STAThread]
+		static void Main(string[] args)
+		{
+            TimerTest myTimerTest = new TimerTest();
+
+            myTimerTest.SendChange();
+
+            Console.WriteLine("Press Enter to exit.");
+            Console.ReadLine();
+		}
+	}
+}