public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
From: pmuldoon@sourceware.org
To: frysk-cvs@sourceware.org
Subject: [SCM]  master: Synchronize access around hpd output bufer. Fix 5735.
Date: Wed, 06 Feb 2008 12:11:00 -0000	[thread overview]
Message-ID: <20080206121113.3194.qmail@sourceware.org> (raw)

The branch, master has been updated
       via  3726744ee5596fbf93d91961a93e59ebb9cdc424 (commit)
      from  3a82019364ca09b1f91b968064aaff746654ff33 (commit)

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

- Log -----------------------------------------------------------------
commit 3726744ee5596fbf93d91961a93e59ebb9cdc424
Author: Phil Muldoon <pmuldoon@redhat.com>
Date:   Wed Feb 6 12:11:06 2008 +0000

    Synchronize access around hpd output bufer. Fix 5735.
    
    2008-02-06  Phil Muldoon  <pmuldoon@redhat.com>
    
           * CLI.java (addMessage): Synchronize on message.
           (flushMessages): Ditto.

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

Summary of changes:
 frysk-core/frysk/hpd/CLI.java  |   34 +++++++++++++++++++---------------
 frysk-core/frysk/hpd/ChangeLog |    5 +++++
 2 files changed, 24 insertions(+), 15 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/hpd/CLI.java b/frysk-core/frysk/hpd/CLI.java
index c08fb3d..61f5033 100644
--- a/frysk-core/frysk/hpd/CLI.java
+++ b/frysk-core/frysk/hpd/CLI.java
@@ -313,7 +313,9 @@ public class CLI {
     }
 
     void addMessage(Message msg) {
-        messages.add(msg);
+	synchronized (messages) {
+	    messages.add(msg);
+	}
     }
 
     void addMessage(String msg, int type) {
@@ -321,20 +323,22 @@ public class CLI {
     }
 
     private void flushMessages() {
-        for (Iterator iter = messages.iterator(); iter.hasNext();) {
-            Message tempmsg = (Message) iter.next();
-	    String prefix = null;
-            if (tempmsg.getType() == Message.TYPE_DBG_ERROR)
-                prefix = "Internal debugger error:  ";
-            else if (tempmsg.getType() == Message.TYPE_ERROR)
-                prefix = "Error: ";
-            else if (tempmsg.getType() == Message.TYPE_WARNING)
-                prefix = "Warning: ";
-            if (prefix != null)
-                outWriter.print(prefix);
-            outWriter.println(tempmsg.getMessage());
-            iter.remove();
-        }
+	synchronized (messages) {
+	    for (Iterator iter = messages.iterator(); iter.hasNext();) {
+		Message tempmsg = (Message) iter.next();
+		String prefix = null;
+		if (tempmsg.getType() == Message.TYPE_DBG_ERROR)
+		    prefix = "Internal debugger error:  ";
+		else if (tempmsg.getType() == Message.TYPE_ERROR)
+		    prefix = "Error: ";
+		else if (tempmsg.getType() == Message.TYPE_WARNING)
+		    prefix = "Warning: ";
+		if (prefix != null)
+		    outWriter.print(prefix);
+		outWriter.println(tempmsg.getMessage());
+		iter.remove();
+	    }
+	}
     }
 
     PTSet createSet(String set) {
diff --git a/frysk-core/frysk/hpd/ChangeLog b/frysk-core/frysk/hpd/ChangeLog
index cb14df0..ba4301b 100644
--- a/frysk-core/frysk/hpd/ChangeLog
+++ b/frysk-core/frysk/hpd/ChangeLog
@@ -1,3 +1,8 @@
+2008-02-06  Phil Muldoon  <pmuldoon@redhat.com>
+
+	* CLI.java (addMessage): Synchronize on message.
+	(flushMessages): Ditto.
+
 2008-02-05  Andrew Cagney  <cagney@redhat.com>
 
 	* GenerateCoreCommand.java: Update; corefiles moved to


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


                 reply	other threads:[~2008-02-06 12:11 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=20080206121113.3194.qmail@sourceware.org \
    --to=pmuldoon@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).