2002/07/19 04:43:47
authormegacz <megacz@xwt.org>
Fri, 30 Jan 2004 06:49:10 +0000 (06:49 +0000)
committermegacz <megacz@xwt.org>
Fri, 30 Jan 2004 06:49:10 +0000 (06:49 +0000)
darcs-hash:20040130064910-2ba56-17adc56377120dd05a664392592886357f9ee797.gz

src/org/xwt/MessageQueue.java
src/org/xwt/XMLRPC.java

index b5f7fde..b6643c6 100644 (file)
@@ -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;
index 12a8361..7f5355b 100644 (file)
@@ -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);
         }
     }