Patch: thread finalization

Tom Tromey tromey@cygnus.com
Wed Aug 18 12:49:00 GMT 1999


I'm committing this patch.  It arranges for dead threads to be removed
from their containing ThreadGroup.  This allows the thread to be
collected, and thus finalized.

1999-08-18  Tom Tromey  <tromey@cygnus.com>

	* java/lang/ThreadGroup.java: Fixed now-erroneous comment.
	* java/lang/natThread.cc (finish_): Call ThreadGroup.remove.

Tom

Index: java/lang/ThreadGroup.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/ThreadGroup.java,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 ThreadGroup.java
--- ThreadGroup.java	1999/04/07 14:52:38	1.1.1.1
+++ ThreadGroup.java	1999/08/18 19:45:08
@@ -80,9 +80,7 @@
   }
 
   // This is called by the Thread code to remove a Thread from our
-  // internal list.  FIXME: currently, it isn't called at all.  There
-  // doesn't appear to be any way to remove a Thread from a
-  // ThreadGroup (except the unimplemented destroy method).
+  // internal list.
   final void remove (Thread t)
   {
     threads.removeElement(t);
Index: java/lang/natThread.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/natThread.cc,v
retrieving revision 1.2
diff -u -r1.2 natThread.cc
--- natThread.cc	1999/08/18 03:48:37	1.2
+++ natThread.cc	1999/08/18 19:45:12
@@ -250,6 +250,8 @@
       _Jv_MutexUnlock (&t->interrupt_mutex);
     }
 
+  group->remove (this);
+
   _Jv_MonitorExit (this);
 }
 


More information about the Java-patches mailing list