2004/01/27 05:22:40
[org.ibex.core.git] / 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--;