public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
* [SCM]  master: Synchronize access around hpd output bufer. Fix 5735.
@ 2008-02-06 12:11 pmuldoon
  0 siblings, 0 replies; only message in thread
From: pmuldoon @ 2008-02-06 12:11 UTC (permalink / raw)
  To: frysk-cvs

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


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

only message in thread, other threads:[~2008-02-06 12:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-06 12:11 [SCM] master: Synchronize access around hpd output bufer. Fix 5735 pmuldoon

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).