From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7784 invoked by alias); 13 Mar 2008 22:49:42 -0000 Received: (qmail 7755 invoked by uid 367); 13 Mar 2008 22:49:41 -0000 Date: Thu, 13 Mar 2008 22:49:00 -0000 Message-ID: <20080313224941.7740.qmail@sourceware.org> From: cagney@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Delete StopEventLoopWhenProcRemoved; almost. X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: e658a312e7c6efa7179f2bf52bd725b5e4a96d70 X-Git-Newrev: ca3e9c22f4a2362a49d8601672250f4de609a9ae Mailing-List: contact frysk-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-cvs-owner@sourceware.org Reply-To: frysk@sourceware.org X-SW-Source: 2008-q1/txt/msg00364.txt.bz2 The branch, master has been updated via ca3e9c22f4a2362a49d8601672250f4de609a9ae (commit) from e658a312e7c6efa7179f2bf52bd725b5e4a96d70 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit ca3e9c22f4a2362a49d8601672250f4de609a9ae Author: Andrew Cagney Date: Thu Mar 13 18:48:25 2008 -0400 Delete StopEventLoopWhenProcRemoved; almost. frysk-core/frysk/proc/ChangeLog 2008-03-13 Andrew Cagney * TestExec.java: Use StopEventLoopWhenProcTerminated; inline StopEventLoopWhenProcRemoved. frysk-core/frysk/testbed/ChangeLog 2008-03-13 Andrew Cagney * StopEventLoopWhenProcRemoved.java: Delete. ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/proc/ChangeLog | 3 + frysk-core/frysk/proc/TestExec.java | 18 ++++- frysk-core/frysk/testbed/ChangeLog | 4 + .../testbed/StopEventLoopWhenProcRemoved.java | 86 -------------------- 4 files changed, 22 insertions(+), 89 deletions(-) delete mode 100644 frysk-core/frysk/testbed/StopEventLoopWhenProcRemoved.java First 500 lines of diff: diff --git a/frysk-core/frysk/proc/ChangeLog b/frysk-core/frysk/proc/ChangeLog index 8ea31e7..5c5b3ee 100644 --- a/frysk-core/frysk/proc/ChangeLog +++ b/frysk-core/frysk/proc/ChangeLog @@ -6,6 +6,9 @@ 2008-03-13 Andrew Cagney + * TestExec.java: Use StopEventLoopWhenProcTerminated; inline + StopEventLoopWhenProcRemoved. + * TestTaskClonedObserver.java: Use StopEventLoopWhenProcTerminated. diff --git a/frysk-core/frysk/proc/TestExec.java b/frysk-core/frysk/proc/TestExec.java index e7355a6..26c75da 100644 --- a/frysk-core/frysk/proc/TestExec.java +++ b/frysk-core/frysk/proc/TestExec.java @@ -37,12 +37,11 @@ // version and license this file solely under the GPL without // exception. - package frysk.proc; import frysk.testbed.TearDownFile; import frysk.testbed.TestLib; -import frysk.testbed.StopEventLoopWhenProcRemoved; +import frysk.testbed.StopEventLoopWhenProcTerminated; import frysk.testbed.TaskObserverBase; import frysk.testbed.ExecOffspring; import frysk.testbed.ExecCommand; @@ -110,7 +109,7 @@ public class TestExec assertTrue("tmp file exists", tmpFile.stillExists()); // Unblock the process, let it exit. - new StopEventLoopWhenProcRemoved(child); + new StopEventLoopWhenProcTerminated(child); task.requestUnblock(execBlockCounter); assertRunUntilStop("wait for exec program exit"); @@ -150,6 +149,19 @@ public class TestExec mainTask.getProc().getTasks().size()); // Set things up to stop once the exec task exits. + class StopEventLoopWhenProcRemoved implements java.util.Observer { + private int pid; + StopEventLoopWhenProcRemoved(ExecOffspring pid) { + this.pid = pid.getPid().intValue(); + Manager.host.observableProcRemovedXXX.addObserver(this); + } + public void update(java.util.Observable o, Object obj) { + Proc proc = (Proc) obj; + if (proc.getPid() == this.pid) { + Manager.eventLoop.requestStop(); + } + } + } new StopEventLoopWhenProcRemoved(child); mainTask.requestUnblock(execBlockCounter); assertRunUntilStop("wait for exec program exit"); diff --git a/frysk-core/frysk/testbed/ChangeLog b/frysk-core/frysk/testbed/ChangeLog index 0e284b3..26a61f6 100644 --- a/frysk-core/frysk/testbed/ChangeLog +++ b/frysk-core/frysk/testbed/ChangeLog @@ -1,3 +1,7 @@ +2008-03-13 Andrew Cagney + + * StopEventLoopWhenProcRemoved.java: Delete. + 2008-03-12 Andrew Cagney * TaskCounter.java: Delete. diff --git a/frysk-core/frysk/testbed/StopEventLoopWhenProcRemoved.java b/frysk-core/frysk/testbed/StopEventLoopWhenProcRemoved.java deleted file mode 100644 index a0e7dc4..0000000 --- a/frysk-core/frysk/testbed/StopEventLoopWhenProcRemoved.java +++ /dev/null @@ -1,86 +0,0 @@ -// This file is part of the program FRYSK. -// -// Copyright 2005, 2006, 2007, 2008, Red Hat Inc. -// -// FRYSK is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by -// the Free Software Foundation; version 2 of the License. -// -// FRYSK is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with FRYSK; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -// -// In addition, as a special exception, Red Hat, Inc. gives You the -// additional right to link the code of FRYSK with code not covered -// under the GNU General Public License ("Non-GPL Code") and to -// distribute linked combinations including the two, subject to the -// limitations in this paragraph. Non-GPL Code permitted under this -// exception must only link to the code of FRYSK through those well -// defined interfaces identified in the file named EXCEPTION found in -// the source code files (the "Approved Interfaces"). The files of -// Non-GPL Code may instantiate templates or use macros or inline -// functions from the Approved Interfaces without causing the -// resulting work to be covered by the GNU General Public -// License. Only Red Hat, Inc. may make changes or additions to the -// list of Approved Interfaces. You must obey the GNU General Public -// License in all respects for all of the FRYSK code and other code -// used in conjunction with FRYSK except the Non-GPL Code covered by -// this exception. If you modify this file, you may extend this -// exception to your version of the file, but you are not obligated to -// do so. If you do not wish to provide this exception without -// modification, you must delete this exception statement from your -// version and license this file solely under the GPL without -// exception. - -package frysk.testbed; - -import java.util.Observer; -import java.util.Observable; -import frysk.proc.Proc; -import frysk.rsl.Log; -import frysk.proc.Manager; -import frysk.sys.ProcessIdentifier; -import frysk.sys.ProcessIdentifierFactory; - -/** - * An observer that stops the eventloop when the process with the - * given pid is removed. - */ -public class StopEventLoopWhenProcRemoved implements Observer { - private static final Log fine - = Log.fine(StopEventLoopWhenProcRemoved.class); - - public boolean p; - - private ProcessIdentifier pid; - - public StopEventLoopWhenProcRemoved(ProcessIdentifier pid) { - this.pid = pid; - Manager.host.observableProcRemovedXXX.addObserver(this); - } - public StopEventLoopWhenProcRemoved(Offspring pid) { - this(pid.getPid()); - } - public StopEventLoopWhenProcRemoved(Proc proc) { - this(ProcessIdentifierFactory.create(proc.getPid())); - } - - public void update (Observable o, Object obj) { - Proc proc = (Proc) obj; - if (proc.getPid() == this.pid.intValue()) { - // Shut things down. - fine.log(this, "update", proc, - "has been removed stopping event loop"); - Manager.eventLoop.requestStop(); - p = true; - } else { - fine.log(this, "update", proc, - "has been removed NOT stopping event loop"); - } - } -} hooks/post-receive -- frysk system monitor/debugger