[Mono-bugs] [Bug 77847][Min] Changed - [PATCH] "Too many threads" error when starting and stopping a timer repeatedly

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun Dec 17 02:14:45 EST 2006


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 cmorgan at alum.wpi.edu.

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

--- shadow/77847	2006-12-16 14:12:53.000000000 -0500
+++ shadow/77847.tmp.31117	2006-12-17 02:14:45.000000000 -0500
@@ -143,6 +143,50 @@
 
 
 ------- Additional Comments From robertj at gmx.net  2006-12-16 14:12 -------
 If you can find a test case that succeeds on MS.NET but fails
 on Mono, please attach it.
 
+
+------- Additional Comments From cmorgan at alum.wpi.edu  2006-12-17 02:14 -------
+Hi Robert.
+
+When I saw your message about not thread-safe I was hoping this was
+the issue. Currently I have a setup like below(after adding the
+locking in):
+
+void OnTimeoutEvent()
+{
+  lock(thisLock)
+  {
+    Close();
+  }
+}
+
+void Complete()
+{
+  lock(thisLock)
+  {
+    timer.Stop();
+    timer.Start();
+  }
+}
+
+public void Close()
+{
+  lock(thisLock)
+  {
+    timer.Stop();
+    timer.Dispose();
+  }
+}
+
+Even with the locks I still see this error.
+
+I tried to reproduce this error with a simple test program but haven't
+been successful in doing so.
+
+Is there some way I can modify the timer class to trap the offending
+thread to see what the timing is that causes the issue? Could there
+still be a race in the timer?
+
+Chris


More information about the mono-bugs mailing list