aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/lang/PosixProcess.java
diff options
context:
space:
mode:
authorTom Tromey <tromey@gcc.gnu.org>2007-01-09 19:58:05 +0000
committerTom Tromey <tromey@gcc.gnu.org>2007-01-09 19:58:05 +0000
commit97b8365cafc3a344a22d3980b8ed885f5c6d8357 (patch)
tree996a5f57d4a68c53473382e45cb22f574cb3e4db /libjava/java/lang/PosixProcess.java
parentc648dedbde727ca3f883bb5fd773aa4af70d3369 (diff)
downloadgcc-97b8365cafc3a344a22d3980b8ed885f5c6d8357.zip
gcc-97b8365cafc3a344a22d3980b8ed885f5c6d8357.tar.gz
gcc-97b8365cafc3a344a22d3980b8ed885f5c6d8357.tar.bz2
Merged gcj-eclipse branch to trunk.
From-SVN: r120621
Diffstat (limited to 'libjava/java/lang/PosixProcess.java')
-rw-r--r--libjava/java/lang/PosixProcess.java47
1 files changed, 20 insertions, 27 deletions
diff --git a/libjava/java/lang/PosixProcess.java b/libjava/java/lang/PosixProcess.java
index fbd6c4c..23e1da9 100644
--- a/libjava/java/lang/PosixProcess.java
+++ b/libjava/java/lang/PosixProcess.java
@@ -1,5 +1,5 @@
// PosixProcess.java - Subclass of Process for POSIX systems.
-/* Copyright (C) 1998, 1999, 2004 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2004, 2006 Free Software Foundation
This file is part of libgcj.
@@ -25,19 +25,15 @@ import java.util.Map;
* @author David Daney <ddaney@avtrex.com> Rewrote using
* ProcessManager
*/
-
-// This is entirely internal to our implementation.
-// This file is copied to `ConcreteProcess.java' before compilation.
-// Hence the class name apparently does not match the file name.
-final class ConcreteProcess extends Process
+final class PosixProcess extends Process
{
static class ProcessManager extends Thread
{
/**
- * A list of {@link ConcreteProcess ConcreteProcesses} to be
+ * A list of {@link PosixProcess PosixProcesses} to be
* started. The queueLock object is used as the lock Object
* for all process related operations. To avoid dead lock
- * ensure queueLock is obtained before ConcreteProcess.
+ * ensure queueLock is obtained before PosixProcess.
*/
List queue = new LinkedList();
private Map pidToProcess = new HashMap();
@@ -52,37 +48,37 @@ final class ConcreteProcess extends Process
}
/**
- * Get the ConcreteProcess object with the given pid and
+ * Get the PosixProcess object with the given pid and
* remove it from the map. This method is called from the
* native code for {@link #reap()). The mapping is removed so
- * the ConcreteProcesses can be GCed after they terminate.
+ * the PosixProcesses can be GCed after they terminate.
*
* @param p The pid of the process.
*/
- private ConcreteProcess removeProcessFromMap(long p)
+ private PosixProcess removeProcessFromMap(long p)
{
- return (ConcreteProcess) pidToProcess.remove(new Long(p));
+ return (PosixProcess) pidToProcess.remove(new Long(p));
}
/**
- * Put the given ConcreteProcess in the map using the Long
+ * Put the given PosixProcess in the map using the Long
* value of its pid as the key.
*
- * @param p The ConcreteProcess.
+ * @param p The PosixProcess.
*/
- void addProcessToMap(ConcreteProcess p)
+ void addProcessToMap(PosixProcess p)
{
pidToProcess.put(new Long(p.pid), p);
}
/**
- * Queue up the ConcreteProcess and awake the ProcessManager.
- * The ProcessManager will start the ConcreteProcess from its
+ * Queue up the PosixProcess and awake the ProcessManager.
+ * The ProcessManager will start the PosixProcess from its
* thread so it can be reaped when it terminates.
*
- * @param p The ConcreteProcess.
+ * @param p The PosixProcess.
*/
- void startExecuting(ConcreteProcess p)
+ void startExecuting(PosixProcess p)
{
synchronized (queueLock)
{
@@ -154,7 +150,7 @@ final class ConcreteProcess extends Process
}
while (queue.size() > 0)
{
- ConcreteProcess p = (ConcreteProcess) queue.remove(0);
+ PosixProcess p = (PosixProcess) queue.remove(0);
p.spawn(this);
}
}
@@ -353,10 +349,7 @@ final class ConcreteProcess extends Process
*/
private native void nativeSpawn();
- // This file is copied to `ConcreteProcess.java' before
- // compilation. Hence the constructor name apparently does not
- // match the file name.
- ConcreteProcess(String[] progarray, String[] envp, File dir)
+ PosixProcess(String[] progarray, String[] envp, File dir)
throws IOException
{
// Check to ensure there is something to run, and avoid
@@ -378,7 +371,7 @@ final class ConcreteProcess extends Process
processManager.waitUntilReady();
}
- // Queue this ConcreteProcess for starting by the ProcessManager.
+ // Queue this PosixProcess for starting by the ProcessManager.
processManager.startExecuting(this);
}
@@ -428,8 +421,8 @@ final class ConcreteProcess extends Process
/** The process id. This is cast to a pid_t on the native side. */
private long pid;
- // FIXME: Why doesn't the friend declaration in ConcreteProcess.h
- // allow ConcreteProcess$ProcessManager native code access these
+ // FIXME: Why doesn't the friend declaration in PosixProcess.h
+ // allow PosixProcess$ProcessManager native code access these
// when they are private?
/** Before the process is forked. */