[Mono-bugs] [Bug 67638][Nor] Changed - Calling mono_thread_attach() creates a foreground thread which prevents the app from exiting normally.

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 7 Oct 2004 14:50:24 -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 vargaz@gmail.com.

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

--- shadow/67638	2004-10-07 11:00:59.000000000 -0400
+++ shadow/67638.tmp.12155	2004-10-07 14:50:24.000000000 -0400
@@ -43,6 +43,15 @@
 
 ------- Additional Comments From vargaz@gmail.com  2004-10-07 11:00 -------
 This will be fixed, but unmanaged threads should call mono_thread_detach  
 () when they no longer want to call into managed code, so the runtime
 can free its data structures etc.
 
+
+------- Additional Comments From vargaz@gmail.com  2004-10-07 14:50 -------
+The problem with creating a background thread is that the runtime does
+not wait for them. So if another thread shuts down the runtime, the
+attached thread can continue running managed code even through the
+runtime data structures etc. are already freed, leading to a crash. So
+I'm not sure this should be changed. The safe way to handle this is to
+call mono_thread_detach () when the thread is no longer wants to
+execute managed code.