public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
From: cagney@sourceware.org
To: frysk-cvs@sourceware.org
Subject: [SCM]  master: Eliminate second last use of observableProcRemovedXXX.
Date: Fri, 14 Mar 2008 16:36:00 -0000	[thread overview]
Message-ID: <20080314163601.3917.qmail@sourceware.org> (raw)

The branch, master has been updated
       via  eb68a3add536b67c08e3bf5f33ee35437bd9a3b3 (commit)
      from  9661b5745777c3085edd270449c255a1466ebfb0 (commit)

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

- Log -----------------------------------------------------------------
commit eb68a3add536b67c08e3bf5f33ee35437bd9a3b3
Author: Andrew Cagney <cagney@redhat.com>
Date:   Fri Mar 14 12:35:07 2008 -0400

    Eliminate second last use of observableProcRemovedXXX.
    
    frysk-core/frysk/ftrace/ChangeLog
    2008-03-14  Andrew Cagney  <cagney@redhat.com>
    
    	* Ftrace.java (ProcRemovedObserver): Re-implement as a Terminated
    	observer.

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

Summary of changes:
 frysk-core/frysk/ftrace/ChangeLog   |    5 ++++
 frysk-core/frysk/ftrace/Ftrace.java |   36 +++++++++++++++++-----------------
 2 files changed, 23 insertions(+), 18 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/ftrace/ChangeLog b/frysk-core/frysk/ftrace/ChangeLog
index 7f65642..cf76d7c 100644
--- a/frysk-core/frysk/ftrace/ChangeLog
+++ b/frysk-core/frysk/ftrace/ChangeLog
@@ -1,3 +1,8 @@
+2008-03-14  Andrew Cagney  <cagney@redhat.com>
+
+	* Ftrace.java (ProcRemovedObserver): Re-implement as a Terminated
+	observer.
+
 2008-03-12  Andrew Cagney  <cagney@redhat.com>
 
 	* TestMappingGuard.java: Use StopEventLoopWhenProcTerminated.
diff --git a/frysk-core/frysk/ftrace/Ftrace.java b/frysk-core/frysk/ftrace/Ftrace.java
index 545ecb9..bb53b21 100644
--- a/frysk-core/frysk/ftrace/Ftrace.java
+++ b/frysk-core/frysk/ftrace/Ftrace.java
@@ -37,7 +37,6 @@
 // version and license this file solely under the GPL without
 // exception.
 
-
 package frysk.ftrace;
 
 import frysk.proc.Action;
@@ -53,11 +52,10 @@ import inua.util.PrintWriter;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
-import java.util.Observable;
-import java.util.Observer;
 import java.util.Set;
 import java.util.Iterator;
-import java.util.logging.*;
+import java.util.logging.Logger;
+import java.util.logging.Level;
 
 public class Ftrace
 {
@@ -265,7 +263,8 @@ public class Ftrace
 	    observationRequested(task);
 	}
 
-	Manager.host.observableProcRemovedXXX.addObserver(new ProcRemovedObserver(proc));
+	new ProcRemovedObserver(proc);
+
 	reporter.eventSingle(task, "attached " + proc.getExe());
 	++numProcesses;
     }
@@ -374,26 +373,27 @@ public class Ftrace
 
 
     /**
-     * An observer to stop the eventloop when the traced process exits.
+     * An observer to stop the eventloop when the traced process
+     * exits.
      */
     private class ProcRemovedObserver
-	implements Observer
+	implements TaskObserver.Terminated
     {
-	int pid;
-
 	ProcRemovedObserver (Proc proc) {
-	    this.pid = proc.getPid();
+	    proc.getMainTask().requestAddTerminatedObserver(this);
 	}
 
-	public void update (Observable o, Object object) {
-	    Proc proc = (Proc) object;
-	    if (proc.getPid() == this.pid) {
-		synchronized (Ftrace.this) {
-		    --numProcesses;
-		    if (numProcesses == 0)
-			Manager.eventLoop.requestStop();
-		}
+	public void addedTo (Object observable)	{}
+	public void addFailed (Object observable, Throwable arg1) {}
+	public void deletedFrom (Object observable) {}
+
+	public Action updateTerminated(Task task, Signal signal, int status) {
+	    synchronized (Ftrace.this) {
+		--numProcesses;
+		if (numProcesses == 0)
+		    Manager.eventLoop.requestStop();
 	    }
+	    return Action.CONTINUE;
 	}
     }
 


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


                 reply	other threads:[~2008-03-14 16:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080314163601.3917.qmail@sourceware.org \
    --to=cagney@sourceware.org \
    --cc=frysk-cvs@sourceware.org \
    --cc=frysk@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).