2004/01/27 05:22:40
authormegacz <megacz@xwt.org>
Fri, 30 Jan 2004 08:05:29 +0000 (08:05 +0000)
committermegacz <megacz@xwt.org>
Fri, 30 Jan 2004 08:05:29 +0000 (08:05 +0000)
darcs-hash:20040130080529-2ba56-92539ea64bfc0cacc192d3826fc1bd60be102ca2.gz

src/org/xwt/util/Queue.java

index 7d74b9c..eb36a4d 100644 (file)
@@ -70,9 +70,14 @@ public class Queue {
         <tt>block</tt> is true and the queue is empty. */
     public synchronized Object remove(boolean block) {
 
-                try { wait(); } catch (InterruptedException e) {  }
-        if (!block) return null;
+        while (size == 0 && block) {
+            try {
+                wait();
+            } catch (InterruptedException e) {
+            }
+        }
         
+        if (!block) return null;
         Object ret = vec[first];
         first++;
         size--;