[PATCH] java.lang.Thread private field access.

Alexandre Petit-Bianco apbianco@cygnus.com
Wed Aug 23 19:06:00 GMT 2000


Because of gcj/309, `alive_flag' from java.lang.Thread was set in
`gnu.gcj.jni.NativeThread'.

This patch was approved by Tom Tromey. I'm checking it in, while
waiting for some feedback on gcj/309 (which I have to revise on the
compiler side anyways.)

./A

2000-08-23  Alexandre Petit-Bianco  <apbianco@cygnus.com>

	* java/util/NativeThread.java (NativeThread): Removed assignment
	to `alive_flag', call `init'.
	(init): New native method.
	* gnu/gcj/jni/natNativeThread.cc (init): New native method
	implementation.

Index: libjava/gnu/gcj/jni/NativeThread.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/gnu/gcj/jni/NativeThread.java,v
retrieving revision 1.2
diff -u -p -r1.2 NativeThread.java
--- NativeThread.java	2000/03/07 19:55:24	1.2
+++ NativeThread.java	2000/08/24 00:41:56
@@ -20,9 +20,10 @@ public class NativeThread extends Thread
   public NativeThread (ThreadGroup g, String name)
   {
     super (g, null, name);
-    alive_flag = true;
+    init ();
   }
 
   // Call this to mark the thread as finished.
   public native void finish ();
+  public native void init ();
 }
Index: libjava/gnu/gcj/jni/natNativeThread.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/gnu/gcj/jni/natNativeThread.cc,v
retrieving revision 1.2
diff -u -p -r1.2 natNativeThread.cc
--- natNativeThread.cc	2000/03/07 19:55:24	1.2
+++ natNativeThread.cc	2000/08/24 00:41:56
@@ -22,3 +22,9 @@ gnu::gcj::jni::NativeThread::finish ()
 {
   finish_ ();
 }
+
+void
+gnu::gcj::jni::NativeThread::init ()
+{
+  alive_flag = true;		// alive_flag is private in java.lang.Thread
+}


More information about the Java-patches mailing list