public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
* [SCM]  master: Remove "int pid" from Wait.java.
@ 2008-02-13 18:49 cagney
  0 siblings, 0 replies; only message in thread
From: cagney @ 2008-02-13 18:49 UTC (permalink / raw)
  To: frysk-cvs

The branch, master has been updated
       via  99f1d55715d6b214ecd85e759fdcfa557149156f (commit)
      from  851f377ecd437051bb64bf347ba1b18e9d16170e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 99f1d55715d6b214ecd85e759fdcfa557149156f
Author: Andrew Cagney <cagney@redhat.com>
Date:   Wed Feb 13 13:49:30 2008 -0500

    Remove "int pid" from Wait.java.
    
    frysk-core/frysk/event/ChangeLog
    2008-02-13  Andrew Cagney  <cagney@redhat.com>
    
    	* WaitEventLoop.java: Update to match frysk.sys.Wait.
    
    frysk-core/frysk/testbed/ChangeLog
    2008-02-13  Andrew Cagney  <cagney@redhat.com>
    
    	* LegacyOffspring.java: Update to match frysk.sys.Wait.
    	* SlaveOffspring.java: Ditto.
    
    frysk-sys/frysk/sys/ChangeLog
    2008-02-13  Andrew Cagney  <cagney@redhat.com>
    
    	* Wait.java (drain(int)): Make private.
    	(drainNoHang(int)): Make private.
    	(waitOnce(int,WaitBuilder)): Rename waitAll.
    	(waitOnce(ProcessIdentifier,WaitBuilder)): Rename waitAll.
    	(wait(int,WaitBuilder,SignalBuilder,long,boolean)): Make private.
    	(wait(WaitBuilder,SignalBuilder,long)): Rename waitAll.
    	(wait(int,WaitBuilder,SignalBuilder,long)): Delete.
    	(waitChild(WaitBuilder,SignalBuilder,long)):
    	Replace wait(ProcessIdentifier,WaitBuilder,SignalBuilder,long,boolean).
    	* TestWait.java: Update.
    	* ProcessIdentifier.java: Update.
    	* cni/Wait.cxx (Wait::waitOnce): Update.
    
    frysk-sys/frysk/sys/ptrace/ChangeLog
    2008-02-13  Andrew Cagney  <cagney@redhat.com>
    
    	* TestPtrace.java: Update frysk.sys.Wait.
    
    frysk-sys/frysk/testbed/ChangeLog
    2008-02-13  Andrew Cagney  <cagney@redhat.com>
    
    	* TearDownProcess.java: Update to match frysk.sys.Wait.

-----------------------------------------------------------------------

Summary of changes:
 frysk-core/frysk/event/ChangeLog              |    4 ++
 frysk-core/frysk/event/WaitEventLoop.java     |    5 +--
 frysk-core/frysk/testbed/ChangeLog            |    5 +++
 frysk-core/frysk/testbed/LegacyOffspring.java |   26 +++++++------
 frysk-core/frysk/testbed/SlaveOffspring.java  |   26 +++++++------
 frysk-sys/frysk/sys/ChangeLog                 |   13 +++++++
 frysk-sys/frysk/sys/ProcessIdentifier.java    |    6 ++--
 frysk-sys/frysk/sys/TestWait.java             |   40 ++++++++++------------
 frysk-sys/frysk/sys/Wait.java                 |   46 ++++++++++---------------
 frysk-sys/frysk/sys/cni/Wait.cxx              |    2 +-
 frysk-sys/frysk/sys/ptrace/ChangeLog          |    4 ++
 frysk-sys/frysk/sys/ptrace/TestPtrace.java    |   10 +++---
 frysk-sys/frysk/testbed/ChangeLog             |    4 ++
 frysk-sys/frysk/testbed/TearDownProcess.java  |    9 ++---
 14 files changed, 108 insertions(+), 92 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/event/ChangeLog b/frysk-core/frysk/event/ChangeLog
index 1c234d1..5a0e1a6 100644
--- a/frysk-core/frysk/event/ChangeLog
+++ b/frysk-core/frysk/event/ChangeLog
@@ -1,3 +1,7 @@
+2008-02-13  Andrew Cagney  <cagney@redhat.com>
+
+	* WaitEventLoop.java: Update to match frysk.sys.Wait.
+
 2008-02-12  Andrew Cagney  <cagney@redhat.com>
 
 	* EventLoop.java: Update to match frysk.sys.Tid.
diff --git a/frysk-core/frysk/event/WaitEventLoop.java b/frysk-core/frysk/event/WaitEventLoop.java
index 6a11709..750eb66 100644
--- a/frysk-core/frysk/event/WaitEventLoop.java
+++ b/frysk-core/frysk/event/WaitEventLoop.java
@@ -82,9 +82,8 @@ class WaitEventLoop
 	    }
 	};
 
-    protected void block (long millisecondTimeout)
-    {
+    protected void block(long millisecondTimeout) {
 	logger.log (Level.FINEST, "{0} block\n", this); 
-	Wait.waitAll (millisecondTimeout, waitBuilder, signalBuilder);
+	Wait.wait(waitBuilder, signalBuilder, millisecondTimeout);
     }
 }
diff --git a/frysk-core/frysk/testbed/ChangeLog b/frysk-core/frysk/testbed/ChangeLog
index d05f950..8bf9cc9 100644
--- a/frysk-core/frysk/testbed/ChangeLog
+++ b/frysk-core/frysk/testbed/ChangeLog
@@ -1,3 +1,8 @@
+2008-02-13  Andrew Cagney  <cagney@redhat.com>
+
+	* LegacyOffspring.java: Update to match frysk.sys.Wait.
+	* SlaveOffspring.java: Ditto.
+
 2008-02-12  Andrew Cagney  <cagney@redhat.com>
 
 	* ExecCommand.java: Update to match frysk.sys.Pid.
diff --git a/frysk-core/frysk/testbed/LegacyOffspring.java b/frysk-core/frysk/testbed/LegacyOffspring.java
index 4b85f72..0f4e572 100644
--- a/frysk-core/frysk/testbed/LegacyOffspring.java
+++ b/frysk-core/frysk/testbed/LegacyOffspring.java
@@ -224,18 +224,20 @@ public class LegacyOffspring
 	kill();
 	try {
 	    while (true) {
-		Wait.waitAll(getPid(), new UnhandledWaitBuilder () {
-			protected void unhandled (String why) {
-			    TestCase.fail ("killing child (" + why + ")");
-			}
-			public void terminated(ProcessIdentifier pid,
-					       Signal signal, int value,
-					       boolean coreDumped) {
-			    // Termination with signal is ok.
-			    TestCase.assertTrue("terminated with signal",
-						signal != null);
-			}
-		    });
+		Wait.waitOnce
+		    (getPid(),
+		     new UnhandledWaitBuilder () {
+			 protected void unhandled (String why) {
+			     TestCase.fail ("killing child (" + why + ")");
+			 }
+			 public void terminated(ProcessIdentifier pid,
+						Signal signal, int value,
+						boolean coreDumped) {
+			     // Termination with signal is ok.
+			     TestCase.assertTrue("terminated with signal",
+						 signal != null);
+			 }
+		     });
 	    }
 	} catch (Errno.Echild e) {
 	    // No more waitpid events.
diff --git a/frysk-core/frysk/testbed/SlaveOffspring.java b/frysk-core/frysk/testbed/SlaveOffspring.java
index 3243ac1..697137a 100644
--- a/frysk-core/frysk/testbed/SlaveOffspring.java
+++ b/frysk-core/frysk/testbed/SlaveOffspring.java
@@ -231,18 +231,20 @@ public class SlaveOffspring
 	kill();
 	try {
 	    while (true) {
-		Wait.waitAll(getPid(), new UnhandledWaitBuilder () {
-			protected void unhandled (String why) {
-			    TestCase.fail ("killing child (" + why + ")");
-			}
-			public void terminated(ProcessIdentifier pid,
-					       Signal signal, int value,
-					       boolean coreDumped) {
-			    // Termination with signal is ok.
-			    TestCase.assertTrue("terminated with signal",
-						signal != null);
-			}
-		    });
+		Wait.waitOnce
+		    (getPid(),
+		     new UnhandledWaitBuilder () {
+			 protected void unhandled (String why) {
+			     TestCase.fail ("killing child (" + why + ")");
+			 }
+			 public void terminated(ProcessIdentifier pid,
+						Signal signal, int value,
+						boolean coreDumped) {
+			     // Termination with signal is ok.
+			     TestCase.assertTrue("terminated with signal",
+						 signal != null);
+			 }
+		     });
 	    }
 	} catch (Errno.Echild e) {
 	    // No more waitpid events.
diff --git a/frysk-sys/frysk/sys/ChangeLog b/frysk-sys/frysk/sys/ChangeLog
index 8aabe38..3a76d02 100644
--- a/frysk-sys/frysk/sys/ChangeLog
+++ b/frysk-sys/frysk/sys/ChangeLog
@@ -1,5 +1,18 @@
 2008-02-13  Andrew Cagney  <cagney@redhat.com>
 
+	* Wait.java (drain(int)): Make private.
+	(drainNoHang(int)): Make private.
+	(waitOnce(int,WaitBuilder)): Rename waitAll.
+	(waitOnce(ProcessIdentifier,WaitBuilder)): Rename waitAll.
+	(wait(int,WaitBuilder,SignalBuilder,long,boolean)): Make private.
+	(wait(WaitBuilder,SignalBuilder,long)): Rename waitAll.
+	(wait(int,WaitBuilder,SignalBuilder,long)): Delete.
+	(waitChild(WaitBuilder,SignalBuilder,long)):
+	Replace wait(ProcessIdentifier,WaitBuilder,SignalBuilder,long,boolean).
+	* TestWait.java: Update.
+	* ProcessIdentifier.java: Update.
+	* cni/Wait.cxx (Wait::waitOnce): Update.
+
 	* Signal.java-sh (kill(int)): Delete.
 	(tkill(int)): Delete.
 	(tkill(int,int)): Make private.
diff --git a/frysk-sys/frysk/sys/ProcessIdentifier.java b/frysk-sys/frysk/sys/ProcessIdentifier.java
index 1c51043..6e76b8f 100644
--- a/frysk-sys/frysk/sys/ProcessIdentifier.java
+++ b/frysk-sys/frysk/sys/ProcessIdentifier.java
@@ -83,13 +83,13 @@ public abstract class ProcessIdentifier implements Comparable {
      * Only returns when the process has disappeared.
      */
     public void blockingDrain() {
-	Wait.drain(intValue());
+	Wait.drain(this);
     }
 
     /**
      * Perform a blocking wait for a single event from this process.
      */
-    public void blockingWait(WaitBuilder o) {
-	Wait.waitAll(intValue(), o);
+    public void blockingWait(WaitBuilder waitBuilder) {
+	Wait.waitOnce(this, waitBuilder);
     }
 }
diff --git a/frysk-sys/frysk/sys/TestWait.java b/frysk-sys/frysk/sys/TestWait.java
index 0f24ff9..a32a652 100644
--- a/frysk-sys/frysk/sys/TestWait.java
+++ b/frysk-sys/frysk/sys/TestWait.java
@@ -86,27 +86,25 @@ public class TestWait
 	assertTrue("timeout", System.currentTimeMillis() <= endTime);
     }
 
-    public void testZeroTimeout ()
-    {
+    public void testZeroTimeout() {
 	assertFalse("waitAll",
-		    Wait.waitAll (0, unhandledWaitBuilder,
-				  unhandledSignalBuilder));
+		    Wait.wait(unhandledWaitBuilder, unhandledSignalBuilder, 0));
     }
 
     public void testShortTimeout() {
-	assertTrue("waitAll", Wait.waitAll (shortTimeout,
-					    unhandledWaitBuilder,
-					    unhandledSignalBuilder));
-	assertTrue ("some time passed",
-		    System.currentTimeMillis () >= startTime + shortTimeout);
+	assertTrue("waitAll", Wait.wait(unhandledWaitBuilder,
+					unhandledSignalBuilder,
+					shortTimeout));
+	assertTrue("some time passed",
+		   System.currentTimeMillis() >= startTime + shortTimeout);
     }
 
     public void testNoTimeout() {
 	WaitOnChild waitOnChild = new WaitOnChild ();
 	ProcessIdentifier pid = Fork.exec(new String[] { "/bin/false" });
 	assertFalse("timeout",
-		    Wait.waitAll(getTimeoutMilliseconds (), waitOnChild,
-				 unhandledSignalBuilder));
+		    Wait.wait(waitOnChild, unhandledSignalBuilder,
+			      getTimeoutMilliseconds()));
 	assertSame("pid", pid, waitOnChild.pid);
     }
 
@@ -116,8 +114,8 @@ public class TestWait
 	Errno e = null;
 	try {
 	    assertFalse("timeout",
-			Wait.wait (-1, waitOnChild, unhandledSignalBuilder,
-				   shortTimeout, false));
+			Wait.waitChild(waitOnChild, unhandledSignalBuilder,
+				       shortTimeout));
 	} catch (Errno.Echild c) {
 	    e = c;
 	}
@@ -137,8 +135,7 @@ public class TestWait
 	}
 	Signals signals = new Signals ();
 	Signal.USR1.tkill(Tid.get ());
-	Wait.waitAll (getTimeoutMilliseconds (),
-		      unhandledWaitBuilder, signals);
+	Wait.wait(unhandledWaitBuilder, signals, getTimeoutMilliseconds());
 	assertTrue ("signals.received", signals.received);
     }
 
@@ -163,8 +160,8 @@ public class TestWait
     public void testWaitExit0() {
 	WaitOnChild waitOnChild = new WaitOnChild();
 	ProcessIdentifier pid = Fork.exec(new String[] { "/bin/true" });
-	Wait.waitAll(getTimeoutMilliseconds(), waitOnChild,
-		     unhandledSignalBuilder);
+	Wait.wait(waitOnChild, unhandledSignalBuilder,
+		  getTimeoutMilliseconds());
 	assertSame("pid", pid, waitOnChild.pid);
 	assertEquals("signal", null, waitOnChild.signal);
 	assertEquals("status", 0, waitOnChild.status);
@@ -173,15 +170,14 @@ public class TestWait
     public void testWaitExit1() {
 	WaitOnChild waitOnChild = new WaitOnChild();
 	ProcessIdentifier pid = Fork.exec(new String[] { "/bin/false" });
-	Wait.waitAll(getTimeoutMilliseconds(), waitOnChild,
-		     unhandledSignalBuilder);
+	Wait.wait(waitOnChild, unhandledSignalBuilder,
+		  getTimeoutMilliseconds());
 	assertSame("pid", pid, waitOnChild.pid);
 	assertEquals("signal", null, waitOnChild.signal);
 	assertEquals("status", 1, waitOnChild.status);
     }
 
-    public void testNoWaitBuilder ()
-    {
-	Wait.waitAll (0, null, unhandledSignalBuilder);
+    public void testNoWaitBuilder() {
+	Wait.wait(null, unhandledSignalBuilder, 0);
     }
 }
diff --git a/frysk-sys/frysk/sys/Wait.java b/frysk-sys/frysk/sys/Wait.java
index c555dbb..4e19c28 100644
--- a/frysk-sys/frysk/sys/Wait.java
+++ b/frysk-sys/frysk/sys/Wait.java
@@ -107,47 +107,37 @@ public final class Wait {
      * Return true if the timeout expired; note that waitpid events
      * may have also been processed.
      */
-    public static boolean wait(ProcessIdentifier pid,
-			       WaitBuilder waitBuilder,
-			       SignalBuilder signalBuilder,
-			       long millisecondTimeout,
-			       boolean ignoreECHILD) {
-	return wait(pid.intValue(), waitBuilder, signalBuilder,
-		    millisecondTimeout, ignoreECHILD);
+    public static boolean waitChild(WaitBuilder waitBuilder,
+				    SignalBuilder signalBuilder,
+				    long millisecondTimeout) {
+	return wait(-1, waitBuilder, signalBuilder, millisecondTimeout, false);
     }
-    public static boolean wait(int pid,
+    public static boolean wait(ProcessIdentifier pid,
 			       WaitBuilder waitBuilder,
 			       SignalBuilder signalBuilder,
 			       long millisecondTimeout) {
-	return wait(pid, waitBuilder, signalBuilder,
+	return wait(pid.intValue(), waitBuilder, signalBuilder,
 		    millisecondTimeout, true);
     }
-    public static boolean wait(ProcessIdentifier pid,
-			       WaitBuilder waitBuilder,
+    public static boolean wait(WaitBuilder waitBuilder,
 			       SignalBuilder signalBuilder,
 			       long millisecondTimeout) {
-	return wait(pid.hashCode(), waitBuilder, signalBuilder,
-		    millisecondTimeout, true);
-    }
-    public static boolean waitAll(long millisecondTimeout,
-				  WaitBuilder waitBuilder,
-				  SignalBuilder signalBuilder) {
 	return wait(-1, waitBuilder, signalBuilder, millisecondTimeout, true);
     }
-    public static native boolean wait(int pid,
-				      WaitBuilder waitBuilder,
-				      SignalBuilder signalBuilder,
-				      long millisecondTimeout,
-				      boolean ignoreECHILD);
+    private static native boolean wait(int pid,
+				       WaitBuilder waitBuilder,
+				       SignalBuilder signalBuilder,
+				       long millisecondTimeout,
+				       boolean ignoreECHILD);
     /**
      * Wait for a single process or task event.  Block if no event is
      * pending (provided that there are still potential events).
      */
-    public static void waitAll(ProcessIdentifier pid,
-			       WaitBuilder builder) {
-	waitAll(pid.intValue(), builder);
+    public static void waitOnce(ProcessIdentifier pid,
+				WaitBuilder builder) {
+	waitOnce(pid.intValue(), builder);
     }
-    public native static void waitAll(int pid, WaitBuilder builder);
+    private static native void waitOnce(int pid, WaitBuilder builder);
 
     /**
      * Non-blocking drain of all pending wait events belonging to pid.
@@ -155,12 +145,12 @@ public final class Wait {
     public static void drainNoHang(ProcessIdentifier pid) {
 	drainNoHang(pid.intValue());
     }
-    public native static void drainNoHang(int pid);
+    private static native void drainNoHang(int pid);
     /**
      * Blocking drain of all pending wait events belonging to pid.
      */
     public static void drain(ProcessIdentifier pid) {
 	drain(pid.intValue());
     }
-    public native static void drain(int pid);
+    private static native void drain(int pid);
 }
diff --git a/frysk-sys/frysk/sys/cni/Wait.cxx b/frysk-sys/frysk/sys/cni/Wait.cxx
index ef0c6fd..cbae31a 100644
--- a/frysk-sys/frysk/sys/cni/Wait.cxx
+++ b/frysk-sys/frysk/sys/cni/Wait.cxx
@@ -289,7 +289,7 @@ frysk::sys::Wait::waitAllNoHang (frysk::sys::WaitBuilder* builder)
 /* Do a blocking wait.  */
 
 void
-frysk::sys::Wait::waitAll (jint wpid, frysk::sys::WaitBuilder* builder)
+frysk::sys::Wait::waitOnce (jint wpid, frysk::sys::WaitBuilder* builder)
 {
   int status;
   errno = 0;
diff --git a/frysk-sys/frysk/sys/ptrace/ChangeLog b/frysk-sys/frysk/sys/ptrace/ChangeLog
index bf54391..2ee295c 100644
--- a/frysk-sys/frysk/sys/ptrace/ChangeLog
+++ b/frysk-sys/frysk/sys/ptrace/ChangeLog
@@ -1,3 +1,7 @@
+2008-02-13  Andrew Cagney  <cagney@redhat.com>
+
+	* TestPtrace.java: Update frysk.sys.Wait.
+
 2008-02-12  Andrew Cagney  <cagney@redhat.com>
 
 	* AddressSpace.java (peek(ProcessIdentifer,long,byte[],int,int))
diff --git a/frysk-sys/frysk/sys/ptrace/TestPtrace.java b/frysk-sys/frysk/sys/ptrace/TestPtrace.java
index d7e8a50..ef9a8a7 100644
--- a/frysk-sys/frysk/sys/ptrace/TestPtrace.java
+++ b/frysk-sys/frysk/sys/ptrace/TestPtrace.java
@@ -73,7 +73,7 @@ public class TestPtrace extends TestCase {
 	TearDownProcess.add(pid);
 	
 	// The initial stop.
-	Wait.waitAll(pid, new UnhandledWaitBuilder() {
+	Wait.waitOnce(pid, new UnhandledWaitBuilder() {
 		private final ProcessIdentifier id = pid;
 		protected void unhandled(String why) {
 		    fail (why);
@@ -85,7 +85,7 @@ public class TestPtrace extends TestCase {
 	    });
 
 	Ptrace.singleStep(pid, Signal.NONE);
-	Wait.waitAll(pid, new UnhandledWaitBuilder() {
+	Wait.waitOnce(pid, new UnhandledWaitBuilder() {
 		private final ProcessIdentifier id = pid;
 		protected void unhandled(String why) {
 		    fail (why);
@@ -97,7 +97,7 @@ public class TestPtrace extends TestCase {
 	    });
 
 	Ptrace.cont(pid, Signal.TERM);
-	Wait.waitAll(pid, new UnhandledWaitBuilder() {
+	Wait.waitOnce(pid, new UnhandledWaitBuilder() {
 		private final ProcessIdentifier id = pid;
 		protected void unhandled(String why) {
 		    fail (why);
@@ -125,7 +125,7 @@ public class TestPtrace extends TestCase {
 	assertTrue ("pid", pid.intValue() > 0);
 
 	Ptrace.attach(pid);
-	Wait.waitAll(pid, new UnhandledWaitBuilder() {
+	Wait.waitOnce(pid, new UnhandledWaitBuilder() {
 		private final ProcessIdentifier id = pid;
 		protected void unhandled(String why) {
 		    fail (why);
@@ -139,7 +139,7 @@ public class TestPtrace extends TestCase {
 	Ptrace.detach(pid, Signal.NONE);
 	Errno errno = null;
 	try {
-	    Wait.waitAll(pid, new UnhandledWaitBuilder() {
+	    Wait.waitOnce(pid, new UnhandledWaitBuilder() {
 		    protected void unhandled(String why) {
 			fail (why);
 		    }
diff --git a/frysk-sys/frysk/testbed/ChangeLog b/frysk-sys/frysk/testbed/ChangeLog
index 5417a44..6e0a8f6 100644
--- a/frysk-sys/frysk/testbed/ChangeLog
+++ b/frysk-sys/frysk/testbed/ChangeLog
@@ -1,3 +1,7 @@
+2008-02-13  Andrew Cagney  <cagney@redhat.com>
+
+	* TearDownProcess.java: Update to match frysk.sys.Wait.
+
 2008-02-12  Andrew Cagney  <cagney@redhat.com>
 
 	* ForkFactory.java: Use frysk.sys.ptrace.
diff --git a/frysk-sys/frysk/testbed/TearDownProcess.java b/frysk-sys/frysk/testbed/TearDownProcess.java
index d7123b6..f74104e 100644
--- a/frysk-sys/frysk/testbed/TearDownProcess.java
+++ b/frysk-sys/frysk/testbed/TearDownProcess.java
@@ -187,9 +187,8 @@ public class TearDownProcess {
 	try {
 	    while (!waitTimedOut && ! pidsToKillDuringTearDown.isEmpty()) {
 		fine.log("wait -1 ....");
-		waitTimedOut = Wait.wait
-		    (-1,
-		     new WaitBuilder() {
+		waitTimedOut = Wait.waitChild
+		    (new WaitBuilder() {
 			 public void cloneEvent(ProcessIdentifier pid,
 						ProcessIdentifier clone) {
 			     capturedSendDetachContKill(pid);
@@ -247,9 +246,7 @@ public class TearDownProcess {
 			     // ignore
 			 }
 		     },
-		     TestCase.getTimeoutMilliseconds(),
-		     false // do not ignore ECHILD
-		     );
+		     TestCase.getTimeoutMilliseconds());
 	    }
 	}
 	catch (Errno.Echild e) {


hooks/post-receive
--
frysk system monitor/debugger


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-02-13 18:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-13 18:49 [SCM] master: Remove "int pid" from Wait.java cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).