[Mono-bugs] [Bug 74350][Maj] New - Thread needs some time to recognize it's running

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 3 Apr 2005 07:54:59 -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 sebastian.droege@gmx.de.

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

--- shadow/74350	2005-04-03 07:54:59.000000000 -0400
+++ shadow/74350.tmp.7655	2005-04-03 07:54:59.000000000 -0400
@@ -0,0 +1,46 @@
+Bug#: 74350
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: sebastian.droege@gmx.de               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Thread needs some time to recognize it's running
+
+Hi,
+the following small testcase returns False (or Unstarted when only the
+first WriteLine() is commented out) most of the starts. sometimes
+(especially when you start the programm again very fast) it returns True.
+When both WriteLine() are executed they return most of the time the
+expected values but sometimes not.
+
+
+
+using System;
+using System.Threading;
+
+public class test
+{
+        static Thread thread;
+
+        public static void Main(string[] args)
+        {
+                thread = new Thread(worker);
+                thread.Start();
+        }
+
+        private static void worker()
+        {
+                System.Console.WriteLine(thread.IsAlive);
+                //System.Console.WriteLine(thread.ThreadState);
+        }
+}