[Mono-bugs] [Bug 61145][Nor] New - System.Thread.Thread.Sleep throws NullReferenceException on non-static Instance threads.

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 4 Jul 2004 11:08:04 -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 mcma6671@bellsouth.net.

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

--- shadow/61145	2004-07-04 11:08:04.000000000 -0400
+++ shadow/61145.tmp.19145	2004-07-04 11:08:04.000000000 -0400
@@ -0,0 +1,57 @@
+Bug#: 61145
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: Debian unstable using latest packages Mono v 1.0
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: mcma6671@bellsouth.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: System.Thread.Thread.Sleep throws NullReferenceException on non-static Instance threads.
+
+Description of Problem:
+System.Threading.Thread.Sleep(int) method throws NullReferenceException
+when called inside an Instance thread.
+
+Example:
+http://msdn.microsoft.com/library/en-us/cpguide/html/cpconCreatingThreads.asp?frame=true
+
+This code will NOT run!
+
+Steps to reproduce the problem:
+1. Create a class with non-static methods, at least one of which contains a
+call to System.Threading.Thread.Sleep(int)
+2. Create the class.
+3. Create a new thread with the method from #1 as the Thread Delegate. 
+This can either be done inside the initializer for the class or from
+outside the class.
+4. Start the thread.
+5. The thread should crash upon the first Sleep(int) call
+
+Actual Results:
+Unhandled Exception: System.NullReferenceException: Object reference not
+set to an instance of an object
+in (unmanaged) (wrapper managed-to-native)
+System.Threading.Thread:Sleep_internal (int)
+in <0x00004> (wrapper managed-to-native)
+System.Threading.Thread:Sleep_internal (int)
+in <0x00064> System.Threading.Thread:Sleep (int)
+in <0x00019> ServerClass:StaticMethod ()
+in <0x0005f> (wrapper delegate-invoke) System.MulticastDelegate:invoke_void ()
+
+
+Expected Results:
+
+
+How often does this happen? 
+Always.
+
+
+Additional Information: