From: megacz Date: Fri, 30 Jan 2004 06:49:10 +0000 (+0000) Subject: 2002/07/19 04:43:47 X-Git-Tag: RC3~1621 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=a1c5591968de1f1aff5fdd497e0410a77b6281d3;p=org.ibex.core.git 2002/07/19 04:43:47 darcs-hash:20040130064910-2ba56-17adc56377120dd05a664392592886357f9ee797.gz --- diff --git a/src/org/xwt/MessageQueue.java b/src/org/xwt/MessageQueue.java index b5f7fde..b6643c6 100644 --- a/src/org/xwt/MessageQueue.java +++ b/src/org/xwt/MessageQueue.java @@ -32,7 +32,7 @@ public class MessageQueue extends Thread { private static Queue events = new Queue(50); /** the number of objects in the queue that are not subclasses of ThreadMessage */ - private static volatile int nonThreadEventsInQueue = 0; + public static volatile int nonThreadEventsInQueue = 0; /** the message currently being performed */ static Message currentlyPerforming = null; diff --git a/src/org/xwt/XMLRPC.java b/src/org/xwt/XMLRPC.java index 12a8361..7f5355b 100644 --- a/src/org/xwt/XMLRPC.java +++ b/src/org/xwt/XMLRPC.java @@ -406,17 +406,17 @@ class XMLRPC extends XML implements Function { public Filter(InputStream is) { super(is); } public int read() throws IOException { Thread.yield(); - while(MessageQueue.working) try { Thread.sleep(100); } catch (Exception e) { }; + while(MessageQueue.nonThreadEventsInQueue > 0) try { Thread.sleep(100); } catch (Exception e) { }; return super.read(); } public int read(byte[] b) throws IOException { Thread.yield(); - while(MessageQueue.working) try { Thread.sleep(100); } catch (Exception e) { }; + while(MessageQueue.nonThreadEventsInQueue > 0) try { Thread.sleep(100); } catch (Exception e) { }; return super.read(b); } public int read(byte[] b, int i, int j) throws IOException { Thread.yield(); - while(MessageQueue.working) try { Thread.sleep(100); } catch (Exception e) { }; + while(MessageQueue.nonThreadEventsInQueue > 0) try { Thread.sleep(100); } catch (Exception e) { }; return super.read(b, i, j); } }