diff options
-rw-r--r-- | libjava/ChangeLog | 21 | ||||
-rw-r--r-- | libjava/classpath/lib/java/lang/PosixProcess$EOFInputStream.class | bin | 567 -> 567 bytes | |||
-rw-r--r-- | libjava/classpath/lib/java/lang/PosixProcess$ProcessManager.class | bin | 2643 -> 2645 bytes | |||
-rw-r--r-- | libjava/classpath/lib/java/lang/PosixProcess.class | bin | 4143 -> 4143 bytes | |||
-rw-r--r-- | libjava/classpath/lib/java/lang/Thread$State.class | bin | 1242 -> 1242 bytes | |||
-rw-r--r-- | libjava/classpath/lib/java/lang/Thread.class | bin | 10110 -> 10274 bytes | |||
-rw-r--r-- | libjava/java/lang/PosixProcess.java | 7 | ||||
-rw-r--r-- | libjava/java/lang/Thread.h | 4 | ||||
-rw-r--r-- | libjava/java/lang/Thread.java | 27 | ||||
-rw-r--r-- | libjava/java/lang/natThread.cc | 4 |
10 files changed, 55 insertions, 8 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index f6c0ed0..06b507e 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,24 @@ +2007-02-16 David Daney <ddaney@avtrex.com> + + * java/lang/Thread.java (Thread(ThreadGroup, Runnable, String)): Pass + new parameter constructor. + (Thread(ThreadGroup, Runnable, String, long)): Same. + (Thread(String, boolean)): New constructor. + (Thread(Thread, ThreadGroup, Runnable, String): Add parameter + noInheritableThreadLocal, don't call + InheritableThreadLocal.newChildThread if set. + * java/lang/PosixProcess.java(ProcessManager()): Set + noInheritableThreadLocal in super. + * java/lang/natThread.cc (_Jv_AttachCurrentThread): Pass new + parameter to Thread constructor. + (_Jv_AttachCurrentThreadAsDaemon): Same. + * java/lang/Thread.h: Regenerate. + * classpath/lib/java/lang/Thread.class: Same. + * classpath/lib/java/lang/PosixProcess$EOFInputStream.class: Same. + * classpath/lib/java/lang/PosixProcess.class: Same. + * classpath/lib/java/lang/Thread$State.class: Same. + * classpath/lib/java/lang/PosixProcess$ProcessManager.class: Same. + 2007-02-16 Kyle Galloway <kgallowa@redhat.com> * interpret.cc: Add extra DEBUG_LOCALS_INSN calls for multi-slot diff --git a/libjava/classpath/lib/java/lang/PosixProcess$EOFInputStream.class b/libjava/classpath/lib/java/lang/PosixProcess$EOFInputStream.class Binary files differindex b9e9c72..951dbfa 100644 --- a/libjava/classpath/lib/java/lang/PosixProcess$EOFInputStream.class +++ b/libjava/classpath/lib/java/lang/PosixProcess$EOFInputStream.class diff --git a/libjava/classpath/lib/java/lang/PosixProcess$ProcessManager.class b/libjava/classpath/lib/java/lang/PosixProcess$ProcessManager.class Binary files differindex 4c40241..2e260c3 100644 --- a/libjava/classpath/lib/java/lang/PosixProcess$ProcessManager.class +++ b/libjava/classpath/lib/java/lang/PosixProcess$ProcessManager.class diff --git a/libjava/classpath/lib/java/lang/PosixProcess.class b/libjava/classpath/lib/java/lang/PosixProcess.class Binary files differindex f7c5264..dc237fc 100644 --- a/libjava/classpath/lib/java/lang/PosixProcess.class +++ b/libjava/classpath/lib/java/lang/PosixProcess.class diff --git a/libjava/classpath/lib/java/lang/Thread$State.class b/libjava/classpath/lib/java/lang/Thread$State.class Binary files differindex e5ddca2..687bc9f 100644 --- a/libjava/classpath/lib/java/lang/Thread$State.class +++ b/libjava/classpath/lib/java/lang/Thread$State.class diff --git a/libjava/classpath/lib/java/lang/Thread.class b/libjava/classpath/lib/java/lang/Thread.class Binary files differindex 0931579..25ff644 100644 --- a/libjava/classpath/lib/java/lang/Thread.class +++ b/libjava/classpath/lib/java/lang/Thread.class diff --git a/libjava/java/lang/PosixProcess.java b/libjava/java/lang/PosixProcess.java index 23e1da9..517e6f3 100644 --- a/libjava/java/lang/PosixProcess.java +++ b/libjava/java/lang/PosixProcess.java @@ -42,7 +42,12 @@ final class PosixProcess extends Process ProcessManager() { - super("ProcessManager"); + // Use package private Thread constructor to place us in the + // root ThreadGroup with no InheritableThreadLocal. If the + // InheritableThreadLocals were allowed to initialize, they could + // cause a Runtime.exec() to be called causing infinite + // recursion. + super("ProcessManager", true); // Don't keep the (main) process from exiting on our account. this.setDaemon(true); } diff --git a/libjava/java/lang/Thread.h b/libjava/java/lang/Thread.h index bef9dd8..b9116b1 100644 --- a/libjava/java/lang/Thread.h +++ b/libjava/java/lang/Thread.h @@ -53,8 +53,10 @@ public: Thread(::java::lang::Runnable *, ::java::lang::String *); Thread(::java::lang::ThreadGroup *, ::java::lang::Runnable *, ::java::lang::String *); Thread(::java::lang::ThreadGroup *, ::java::lang::Runnable *, ::java::lang::String *, jlong); +public: // actually package-private + Thread(::java::lang::String *, jboolean); private: - Thread(::java::lang::Thread *, ::java::lang::ThreadGroup *, ::java::lang::Runnable *, ::java::lang::String *); + Thread(::java::lang::Thread *, ::java::lang::ThreadGroup *, ::java::lang::Runnable *, ::java::lang::String *, jboolean); public: static jint activeCount(); virtual void checkAccess(); diff --git a/libjava/java/lang/Thread.java b/libjava/java/lang/Thread.java index 84682f3..1e1e860 100644 --- a/libjava/java/lang/Thread.java +++ b/libjava/java/lang/Thread.java @@ -355,7 +355,7 @@ public class Thread implements Runnable */ public Thread(ThreadGroup group, Runnable target, String name) { - this(currentThread(), group, target, name); + this(currentThread(), group, target, name, false); } /** @@ -381,10 +381,26 @@ public class Thread implements Runnable public Thread(ThreadGroup group, Runnable target, String name, long size) { // Just ignore stackSize for now. - this(currentThread(), group, target, name); + this(currentThread(), group, target, name, false); } - private Thread (Thread current, ThreadGroup g, Runnable r, String n) + /** + * Allocate a new Thread object for threads used internally to the + * run time. Runtime threads should not be members of an + * application ThreadGroup, nor should they execute arbitrary user + * code as part of the InheritableThreadLocal protocol. + * + * @param name the name for the Thread + * @param noInheritableThreadLocal if true, do not initialize + * InheritableThreadLocal variables for this thread. + * @throws IllegalThreadStateException if group is destroyed + */ + Thread(String name, boolean noInheritableThreadLocal) + { + this(null, null, null, name, noInheritableThreadLocal); + } + + private Thread (Thread current, ThreadGroup g, Runnable r, String n, boolean noInheritableThreadLocal) { // Make sure the current thread may create a new thread. checkAccess(); @@ -424,7 +440,10 @@ public class Thread implements Runnable int pri = current.getPriority(); priority = (gmax < pri ? gmax : pri); contextClassLoader = current.contextClassLoader; - InheritableThreadLocal.newChildThread(this); + // InheritableThreadLocal allows arbitrary user code to be + // executed, only do this if our caller desires it. + if (!noInheritableThreadLocal) + InheritableThreadLocal.newChildThread(this); } else { diff --git a/libjava/java/lang/natThread.cc b/libjava/java/lang/natThread.cc index 8a09f4f..42f18c4 100644 --- a/libjava/java/lang/natThread.cc +++ b/libjava/java/lang/natThread.cc @@ -490,7 +490,7 @@ _Jv_AttachCurrentThread(jstring name, java::lang::ThreadGroup* group) return thread; if (name == NULL) name = java::lang::Thread::gen_name (); - thread = new java::lang::Thread (NULL, group, NULL, name); + thread = new java::lang::Thread (NULL, group, NULL, name, false); _Jv_AttachCurrentThread (thread); _Jv_NotifyThreadStart (thread); return thread; @@ -504,7 +504,7 @@ _Jv_AttachCurrentThreadAsDaemon(jstring name, java::lang::ThreadGroup* group) return thread; if (name == NULL) name = java::lang::Thread::gen_name (); - thread = new java::lang::Thread (NULL, group, NULL, name); + thread = new java::lang::Thread (NULL, group, NULL, name, false); thread->setDaemon (true); _Jv_AttachCurrentThread (thread); _Jv_NotifyThreadStart (thread); |