[Mono-bugs] [Bug 53078][Nor] Changed - Thread not disposed if Start not called

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 21 Jan 2004 13:42:12 -0500 (EST)


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 derek.mcumber@datamtnsol.com.

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

--- shadow/53078	2004-01-20 13:50:27.000000000 -0500
+++ shadow/53078.tmp.5381	2004-01-21 13:42:12.000000000 -0500
@@ -140,6 +140,27 @@
 Now I am going to try a similar change to ThreadPool.c
 where it calls 'ExitThread(0)'; (return (0) instead?);
 
 ------- Additional Comments From gonzalo@ximian.com  2004-01-20 13:50 -------
 Oh! Yes. Use return 0. I've had that change locally for quite some
 time now.
+
+------- Additional Comments From derek.mcumber@datamtnsol.com  2004-01-21 13:42 -------
+Added fix to the threadpool.c and it appears to be ok:
+
+instead of:
+
+     ExitThread(0);
+
+use this instead:
+
+     thread->state |= ThreadState_Stopped;
+
+     /* tpool_thread_cleanup(thread);  needs to be wrapped and
+exported from threads.h */
+
+     mono_run_finalize(thread, 0);
+
+     return(0);
+
+Note:  finalizer may be run on objects not in hashtable, but it
+should simply return with no error, unless there is a better way.