[Mono-bugs] [Bug 67638][Nor] New - Calling mono_thread_attach() creates a foreground thread which prevents the app from exiting normally.
Tue, 5 Oct 2004 16:53:43 -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 firstname.lastname@example.org.
--- shadow/67638 2004-10-05 16:53:43.000000000 -0400
+++ shadow/67638.tmp.25638 2004-10-05 16:53:43.000000000 -0400
@@ -0,0 +1,37 @@
+Product: Mono: Runtime
+OS Details: SuSE 9.1 Pro
+Summary: Calling mono_thread_attach() creates a foreground thread which prevents the app from exiting normally.
+This is related to bug #66915
+I have a managed API that calls down into unmanaged code through p/invoke
+passing down a delegate marshalled as a function pointer. The unmanaged
+code starts up a new thread to complete an operation asynchronously. When
+the operation is complete it calls back on the function pointer to notify
+the managed API that the operation is complete.
+As noted in bug #66915, doing so causes the VM to crash (in Mono but not in
+.NET). I can work around the problem by adding a call to
+mono_thread_attach(). However, doing so causes a foreground thread to be
+created (Thread.IsBackground = false) and prevents the app from shutting
+Using .NET under Windows a background thread is created to wrap the
+unmanaged thread when it calls back into the managed code. The background
+thread does not block the process from exiting.
+I will attach a sample application that demonstrates the problem.